27
Just realized my indentation was wrecking my scripts
A senior dev looked at my code and said 'your whitespace is screaming at me.' Fixed the spacing and suddenly everything ran clean. Anyone else have a simple fix that made a huge difference?
3 comments
Log in to join the discussion
Log In3 Comments
hollyl4525d ago
Did you try turning your tab key off and back on again?
6
the_simon25d ago
Tabs versus spaces is a REAL war but the REAL secret is CONSISTENCY. I had a project where some files used 2 spaces and some used 4 and the whole thing just BROKE silently. Turned out Python was seeing indentation as 2 spaces in one file and 4 in another and just giving up. Now I set my editor to show whitespace characters and use the same exact setting on every single file. Saved me from a three hour debugging session where the error was just 'inconsistent use of tabs and spaces'.
1