4 ms·
I suspect that two spaces make sense when you also limit the length of line to some maximum below 80. I.e. I suspect that those using 4 or tabs also use long l
by jhrobert 14y ago
I suspect that two spaces make sense when you also limit the length of line to some maximum below 80.
I.e. I suspect that those using 4 or tabs also use long lines.
And long lines are not considered very readable these days...
As a result, my personal conclusion is that two spaces indented code shows a stronger interest in readability.
But I don't have numbers to back this claim and I understand it is contreversial. Maybe the author of this nice tool can add info about long lines?
- atroche 14y agoYup, I'll be looking at that next. Do you keep your line lengths below 80?
- jhrobert 14y agoYes. Actually I limit myself to 79 columns! Not sure why, maybe to escape the idea that 80 is a punch card inherited limit... I am thinking to switch to 72, that's the RFCs limit.
- naiquevin 14y ago> I.e. I suspect that those using 4 or tabs also use long lines. Not really, I think length of indentation affects the length of the line only if there is a lot of nesting. For HTML I use 2 spaces as I know there is going to be a lot of nesting, whereas in JS, not so much, so 4 spaces works perfectly for me. Also, in JS, chained function calls be aligned on multiple lines which makes it more readable as well.
- dvhh 14y agoIIf you are trying to keep your line bellow the 80 cols by tweaking the indent size, my guess is that you have too much code in one line, which is fine, but can make looking back at the code a little bit more painful.