Hacker News new | ask | show | jobs
by nene 5263 days ago
I've been switching between 2 and 4 spaces through my whole programming career. Even now I'm switching daily between different languages and projects with different amount of indentation. And I for one have noticed no correlation between bugs and amount of indentation. But I might be wrong - I have done no actual measurements.

What I can say though, is that there is a correlation between a lousily indented code and bugs. Consistency is the key in indentation. Reading non-consistently indented code, that's what drives you insane... but two instead of four spaces... hardly.

1 comments

This isn't about 2 spaces vs 4 spaces. It's about 2 spaces in a language where blocks are defined only by indentation. That's a HUGE difference.

I have no problem with 2 spaces in C/C++. I have no problems with Pythons use of white-space to define blocks. But the combination is deadly.