5 ms·
43% prefer tabs? Get out! [http://stackoverflow.com/insights/survey/2017/#work-tabs-or-spaces http://stackoverflow.com/insights/survey/2017/#work-tabs-or-...]
by flurdy 10y ago
43% prefer tabs? Get out!
[http://stackoverflow.com/insights/survey/2017/#work-tabs-or-spaces http://stackoverflow.com/insights/survey/2017/#work-tabs-or-...]
- serg_chernata 10y agoTabs are far superior. :)
- tannhaeuser 10y agoThis is the correct answer. The bad developer is identified by the rhythmic noise of arrow keys.
- mbel 10y agoHow arrow keys are related to tab/space flamewar? Isn't everybody (whose job requires typing) using moving between words as the most basic mean of navigation? (w, M-f, Ctrl+arrow, etc.)
- yosamino 10y ago... because they aren't using an editor coughvimcough that correctly positions their cursor automatically or let's them jump to the beginning of a line with a single keystroke ?
- m0sa 10y agoThe problematic ones are the 19.3% who prefer both...
- kbart 10y agoI choose between tabs and spaces depending on existing code base, but prefer neither (or both). When writing code from scratch, it depends on language and text editor used.
- parroquiano 10y agoOn the contrary, those of us who prefer both are the smart ones[0] [0] https://www.emacswiki.org/emacs/SmartTabs https://www.emacswiki.org/emacs/SmartTabs
- rejschaap 10y agoThat's too complicated for the unwashed masses
- flurdy 10y agohttp://www.emacswiki.org/pics/static/TabsSpacesBoth.png http://www.emacswiki.org/pics/static/TabsSpacesBoth.png
- marcosdumay 10y agoIt1s a safe question to estimate the troll numbers.
- Ajedi32 10y agoTabs for indentation, spaces for alignment. That way devs can set whatever tab length they prefer in their editors without messing up alignment.
- TorKlingberg 10y agoYes, strange, I rarely encounter codebases with tabs. I wonder if some of them mean they press the tab key and the editor adds spaces.
- OJFord 10y ago> strange, I rarely encounter codebases with tabs I prefer tabs, but I never use them. It's like social networks, it doesn't matter what you prefer, it matters what your friends prefer. If 57% prefer spaces, well okay I suppose we're using spaces then.
- wtetzner 10y agoI think the problem with tabs is that you inevitably end up using both tabs and spaces. This still OK, as long as tabs are used for indentation, and spaces for alignment. But if you don't have good editor support for it, you'll end up with some lines indented using tabs, and some indented using spaces. So while in theory tabs are superior, in practice they seem to end up being more trouble that they're worth.
- scrollaway 10y agoI've been using tabs in Python for 14 years and I haven't needed to align anything in 13. Join me, it's a wonderful, readable world out there. Indent level alignment is far less readable than just indenting one extra for new context. As for inline alignment, I found its super counterproductive due to diff noises every time you update the members.
- Pharylon 10y agoI use spaces exclusively, but only because everyone else does. Tabs are clearly superior, since their width can be adjusted to look however you like. For instance, I prefer 4 spaces of indentation in Javascript. Another developer here prefers 2. With tabs, we could both be happy.
- strictnein 10y agoYeah, this is the argument that I make as well, and I don't understand why it doesn't just settle the debate. With tabs, everyone can have their code look however they want it to look, even the weirdos who want it to be 8 spaces.
- darth_mastah 10y agoOh, those memories... That's exactly what I thought a convincing argument when I was taking my first steps in development. Everyone can make the code look as they want! But wait... Why would everyone want the code to have different visual indentation? I fail to see the benefit in that. The so called "personal preference" is a hoax. After having given up on tabs I used to think 4 spaces are so amazingly cool, 2 spaces are weird. And then standard came along and finally brought consistency. Of course, they couldn't get it right, and abandoned semicolons, which is why there is also semistandard. Ask Douglas Crockford why you should have semicolons in your code. There is a good reason for that, not based on anyone's "personal preference". The tabs vs 4 spaces vs 2 spaces is not the whole story, oh no. It is merely the beginning. There are many other life threatening problems to solve. Where to put the brackets? Multiple var statement or just one? Space between function name and brackets or no? The list just goes on. You keep thinking what is better. There is no clear answer, one choice is no better than the other but you have to make up your mind. You have to make the decision and stick to it, because code should be consistently formatted. And when you finally decide, it becomes part of you, part of your identity. "I am the guy who has just one var statement! I am the guy who does not bother with a space between function name and the bracket!" Yeah, you're such a cool, original rebel, you are. And if someone tries to take it away from you you get really angry. It is a bit like religion. On some level we know it does not really make sense, but all the same we believe in it because it defines who we are. Douglas is right, you know. We, devs, are not as rational and logic driven as we think we are. We are very irrational and emotions driven, maybe even more than other people around us. 2 spaces in the way of your happiness. Bah!