3 ms·
I 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 instan
by Pharylon 10y ago
I 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!