n
22

That moment I realized I was spacing my code all wrong

I spent like 3 months writing Python scripts and wondered why my loops kept breaking. Turns out I was mixing tabs and spaces without even knowing it. A friend looked over my shoulder one afternoon and said, 'Dude, your indentation is a mess.' He showed me how to turn on visible whitespace in my editor and I felt so dumb. Now I just hit the tab key and let the editor handle everything. Has anyone else had a coding habit that took way too long to figure out?
2 comments

Log in to join the discussion

Log In
2 Comments
the_jessica
honestly i used to be one of those people who was like "spaces are better" and i would manually hit the spacebar four times every time i needed to indent. i thought i was being so clean and proper about it. then i started working on a project with someone else and they were like why does your code look all jacked up. turns out i was putting 3 spaces sometimes and 4 spaces other times because i was rushing. now i just use tabs and let the editor do its thing. it saves so much time and i dont have to think about my spacing at all anymore.
3
fisher.charlie
Guess you found out the hard way that spaces don't pay the bills!
1