S
28

Took me 6 months to figure out I was indenting with tabs when the course used spaces

Kept getting syntax errors on my Python assignments for weeks until I opened my code on a different editor and saw every line was jagged. Has anyone else had a formatting habit screw up their whole project without realizing it?
2 comments

Log in to join the discussion

Log In
2 Comments
jakel36
jakel3621d ago
Tabs vs spaces has messed up more beginners than just about anything else. A buddy of mine spent three days tracking down a bug in his HTML only to find out his editor was mixing tabs and spaces in the same file. The worst part is when you submit something for a class or a job and the reviewer sees a mess of jagged lines right away. That first impression kills you. Once you lock into one way of indenting, it becomes muscle memory and switching feels like learning to write with your other hand.
6
diana20
diana2021d ago
Read a blog post a while back that said Python's official guide actually recommends 4 spaces per indent. That settled it for me. Once you get used to one way the other just feels wrong.
1