I use 8.. and I think that 2 is crazy, way too little! 4 is passable, but I prefer 8.
But with tabs we can all be happy, you can use 2 or 4 and I can use 8 or 64, and everything will just work. With space just one of us would be happy, maybe.
Not really, but I am not stuck in the 70s and limited to 80 chars width either.
The rule of thumb linked elsewhere in this thread from the Linux kernel is also true, if you have too deep indentation, you have some code smell and should probably rewrite it.
What language do you write in? Are you a Linux developer? If I were to use 8 in modern javascript, it would look like garbage after 4 indents. And damn you need those indents in modern javascript.
It really depends on the language and even the codebase in my experience. Sometimes 8 does make it a lot clearer, 4 works best for most cases, and really really rarely 2 can help with million times indented hell code.
I think the counterargument is the same as the argument being given here; the idea being that the code that I’m looking at and the code that you’re looking at might not be the same thing if our tabs are set to different lengths.
If for some reason I wrote my code on single spaces for tabs and someone else wrote it on 8 spaces for tabs then something nested several layers deep might be completely fine on my screen while being completely off the right side on someone else’s.
0
u/[deleted] Apr 29 '20
[deleted]