Live data from Hacker News

Developers who use spaces make more money than those who use tabs

stackoverflow.blog

81–90 of 690 posts

Re: Developers who use spaces make more money than those who use tabs

#81
post #61

Pretty simple: you use spaces because you're aware that there is more than one IDE/editor in this world and who knows what your code will get opened with tomorrow. This means you consider consequences beyond "but it works on my machine" so you're a better programmer. Ergo, higher salary.

Almost everyone I know who uses spaces or tabs does so because that's either the default on their IDE, or for their language. So this holier-than-thou argument holds less water than the sun.

On the other hand, I find 2-space-indented code unreadable; in fact, 4-space wide indentation is the only size I find to be readable. I know plenty of people for whom that isn't the case. Using tabs lets the reader set the indentation level.

¯\_(ツ)_/¯

Edit: All the anti-tab arguments I'm reading below boil down to alignment. Don't align folks; there's good reasons not to align regardless of your indent style.

Re: Developers who use spaces make more money than those who use tabs

#83
post #70
post #61

Pretty simple: you use spaces because you're aware that there is more than one IDE/editor in this world and who knows what your code will get opened with tomorrow. This means you consider consequences beyond "but it works on my machine" so you're a better programmer. Ergo, higher salary.

I think there's probably some truth to considering existing norms and thinking ahead, but find it unlikely to be the main confounder. How do tabs fail to work in other editors/IDEs?

They might be configured differently, and you usually can't align stuff properly using just tabs, you have to use a space or three somewhere. Also, you never know if it's spaces, tabs or a combination of them in existing code - which you may have not written yourself.

So in the long run, the indentation WILL get fucked up and you WILL miss something when fixing a bug in code that you or someone else wrote 6 months ago. And your 10 minute bug fix will take 3 hours. Multiply both values by a constant factor as necessary.

It's simply not worth the trouble.

Re: Developers who use spaces make more money than those who use tabs

#84
post #61

Pretty simple: you use spaces because you're aware that there is more than one IDE/editor in this world and who knows what your code will get opened with tomorrow. This means you consider consequences beyond "but it works on my machine" so you're a better programmer. Ergo, higher salary.

In fact, tabs are better for compatibility: other people might like other indentation sizes. If you keep your stuff consistently with tabs, and use spaces for alignment instead of having your IDE auto-replace tabs there as well, your code will look great with whatever tab size someone chooses. And extra pro: in dumb editors, you automatically get the right thing.

unless you have anything aligned in columns then all bets are off (something which many code formatters can do automatically for you e.g. lists of bindings)

Re: Developers who use spaces make more money than those who use tabs

#88
post #61

Pretty simple: you use spaces because you're aware that there is more than one IDE/editor in this world and who knows what your code will get opened with tomorrow. This means you consider consequences beyond "but it works on my machine" so you're a better programmer. Ergo, higher salary.

In fact, tabs are better for compatibility: other people might like other indentation sizes. If you keep your stuff consistently with tabs, and use spaces for alignment instead of having your IDE auto-replace tabs there as well, your code will look great with whatever tab size someone chooses. And extra pro: in dumb editors, you automatically get the right thing.

Tabs are only better for compatibility if you know that no one who touches the code will ever use spaces.

Re: Developers who use spaces make more money than those who use tabs

#89

correlation != causation

Which doesn't matter.

Correlation still:

(a) implies causation (it's a necessary attribute of causation, just not a sufficient one).

(b) makes it statistically more probable for someone to be making more money than another, if they use spaces and the other doesn't

Re: Developers who use spaces make more money than those who use tabs

#90
post #9

Earlier quoted context omitted.

But there's an actual causation here (you need more money to buy a Tesla). Use of tabs and salary don't seem to have any relation one way or an other. My personal guess would be that using spaces is a practical decision and might be more popular towards older, more experienced devs (who are therefore better paid). On paper tabs sounds better, they're "configurable", you should indent with tabs and align with spaces,…

> My personal guess would be that using spaces is a practical decision and might be more popular towards older, more experienced devs (who are therefore better paid). They explicitly rejected this explanation after controlling for years of experience.

Oh, you're right. My mistake.

That being said I'd be curious to see "years of experience working in a team", because that's really when using tabs starts becoming tricky. If you're well disciplined and are the only person messing with your codebase the issues I mentioned in my previous post don't really apply.

Post reply on HN