5
My friend saw my code and said it looked like alphabet soup
I was showing a friend my first Python script, a simple number guesser. He looked at it for a second and said, 'Dude, you need spaces. This is just a wall of text.' I had all my if and else statements squished together with no blank lines. The next day, I went back and added a line break after each block, and it was like night and day. I could actually see where one part ended and the next began. Has anyone else had a simple tip that made your code way easier to read?
3 comments
Log in to join the discussion
Log In3 Comments
olivia_hernandez2mo ago
Totally get that, spacing is everything. I see this all the time with instructions for flat-pack furniture or appliance manuals, where they cram all the steps into one huge paragraph. Adding that visual break lets your brain catch up and actually process what comes next. It's the same principle with code, just giving your eyes a place to rest.
6
leep891mo ago
Honestly I used to think whitespace was just about making things look pretty, but that furniture manual comparison made me realize it's actually about how your brain processes stuff. Tbh when I first started coding I'd jam everything together because I thought it was cleaner or more efficient somehow. Ngl it wasn't until I had to debug a loop that was 15 lines with zero breaks that I finally got why people preach about spacing.
1