7
Feedback on my code indentation style really changed things
I was in a coding bootcamp for about 3 weeks and kept getting comments from an instructor about my messy indentation. He said something like "your code works but it's unreadable, fix the spacing." I thought it was just a nitpick since everything ran fine. But after he showed me how much easier it is to spot errors when things line up, I started using proper indents with 4 spaces. It took me about 2 days to break the old habit of just hitting tab wherever. Now I can actually follow my own logic when I come back to a project the next day. Has anyone else had a teacher or coworker push you to change a small habit that felt pointless at first?
3 comments
Log in to join the discussion
Log In3 Comments
eva_moore19d ago
Ha, I'll be the one to say it - I've been coding for years and still use whatever spacing feels right in the moment, tabs, spaces, who cares as long as the compiler is happy. Messy indentation never cost me any debugging time, your mileage may vary though.
6
taylor_patel19d ago
Used to be on team "spaces forever" but honestly this thread is making me reconsider. Maybe I've been wasting time obsessing over formatting when the real work is just making the code run right. Good point about the compiler not caring, might loosen up on my strict rules a bit.
1
scott.olivia19d ago
Wow, really? So you've never had to chase down a missing bracket or a mismatched if/else because the visual nesting was all over the place? That's honestly impressive if true, because I feel like my own brain just stops working when the spacing is inconsistent. What happens when you hand your code off to a teammate, do they just deal with the formatting chaos?
4