2 ms·
My theory of tab width is that it should be somewhat proportional to the average height of indented sections of code in that language. That is, if a given lang
by ninkendo 8y ago
My theory of tab width is that it should be somewhat proportional to the average height of indented sections of code in that language.
That is, if a given language is really verbose and requires a lot of code to do simple things, the functions, if-statements, loops, etc will probably be a lot longer (like in C or Go) and so you need wider tabs to help visually align things.
But if a language encourages a style where functions are just a couple of lines long, if statements and loops are rare (or at least comparatively short), having excessively wide indentation can hinder readability.