5 ms·
Well, I think the main argument for tabs is that they will look exactly how each individual wants them to look. If you like things compressed horizontally, set
by kscaldef 17y ago
Well, I think the main argument for tabs is that they will look exactly how each individual wants them to look. If you like things compressed horizontally, set your tab width to 2. If you want things really spacious, set it to 8. Spaces don't give individuals the option to tailor for their preferences.
There are two non-trivial issues in this debate though:
1) mixing spaces and tabs is undeniable evil. Everyone on your team needs to conform to one or the other. (And since I like spaces, everyone should use spaces ;-). )
2) In a layout-based syntax like Haskell's, you cannot set your tab width willy-nilly. The syntax defines a tab as equivalent to 8 spaces. Vary this in your editor at your peril.
- gcv 17y agoI like your problem #1. Using tabs exclusively means that code cannot align nicely in common situations: multi-line function arguments, or parameter lists, or object initialization. So therefore you have to either mix tabs and spaces to achieve proper alignment, or just use spaces. (setq-default indent-tabs-mode nil)
- bkudria 17y agoWhat's wrong with mixing tabs and spaces? The proper way to code is to use tabs to indent, and spaces after to align. So, no spaces before tabs, only after, and tabs should only indent to the current indentation level of the code (obviously).
- kscaldef 17y agoThe problem is that you must adopt a standard tab width for this to approach. Otherwise when you mix this with team members who use only spaces, things with become inconsistent. Also, as I pointed out, with languages like Python & Haskell, it is required to fix the tab width. At this point, where you must dictate a fixed tab width that everyone must use, I fail to see any advantage to using tabs (other than a miniscule reduction in file size).