O
23

Showerthought: I used to write code like a wall of text until a friend said it looked like a ransom note

Back when I was learning Python, I'd cram everything onto one line and never use spaces. A buddy looked at my script and said, 'Dude, this looks like a ransom note, I can't read it.' I mean, he was right. I started using line breaks and adding comments after that, and it made fixing my own mistakes way easier. Has anyone else gotten a piece of feedback that totally changed how you structure your code?
2 comments

Log in to join the discussion

Log In
2 Comments
nancy820
nancy8201mo ago
My old boss actually preferred dense code, said it saved paper when printing. I still write pretty tight but add line breaks for my own sanity.
7
brooke475
brooke4751mo ago
My first code review in college had the word "spaghetti" written in red pen three times. I started leaving a blank line between functions after that, it's like visual breathing room.
4