3 ms·
The anti-tab movement is not specific to Javascript. Most languages have adopted this position, and most IDEs expand tabs to spaces by default now.
by lawnchair_larry 15y ago
The anti-tab movement is not specific to Javascript. Most languages have adopted this position, and most IDEs expand tabs to spaces by default now.
- aaronharder 15y agoBut why that pro-space bias? I've always preferred tabs.
- mattmanser 15y agoBecause different editors handle them wildly differently but spaces are totally unambiguous. With spaces there's no sudden, 'woah, what happened there'.
- __david__ 15y agoBecause there are times when you need to indent to something that isn't a main indentation point, like this: some_function_with_too_many_args(some_argument, another, a_third, and_so_on); That style is problematic with tabs. The only way to make that look right with all different tab settings (8, 4, 2, etc) is to mix tabs and spaces--indent to the main indentation level with tabs and then use spaces to indent the rest of the way. Not many editors do that automatically for you and so it is not a popular style. All spaces is much easier to deal with (at the cost of being non-customizable) and so that seems to be the dominant way of doing things nowadays.