Live data from Hacker News

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

stackoverflow.blog

451–460 of 690 posts

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

#451

Earlier quoted context omitted.

I've grown so tired of sarcasm. Online and in real life people are often saying the exact opposite of what they mean. We have to pick up the sarcasam to truly understand.

sarcasm is one of the true idiosyncrasies of humanity that differentiates us from the machines. Embrace it.

Right up until we can type "include('sarcasm')" and have it work.

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

#452

Earlier quoted context omitted.

> Don't think you make hiring decisions based on tabs vs spaces? I actually ask candidates "spaces or tabs?" in every single interview. I don't really care what the response is in regard to the holy war, and it doesn't mean anything on its own, but having SOME thought out response can be a GREAT indicator of how well versed someone is in general. e.g. I'm going to think way more highly of someone that says "tabs, bec…

> "whatever my editor sets it to". Whats wrong with this? I just accept the defaults. Whether that is what the current project demands or what the editor defaults to. Why waste my time over these things?

> Whats wrong with this? I just accept the defaults. Whether that is what the current project demands or what the editor defaults to.

There's your answer: if letting your editor do whatever and not caring to 'waste time over these things' means you've committed a bunch of code ignorant of the convention respected by the rest of the project, that's not that great.

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

#453

Tabs vs. spaces. 2 vs. 4 spaces. It's an endless discussion. We finally compromised and we're using 3 tabs.

If we would all just agree to set our tab width to 1 space then we could live in harmony...

That's a major problem solved. Now all that's left to do is peace in the middle East.

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

#454
post #351

Earlier quoted context omitted.

wait, but that defeats the purpose of both, right? if you change the width of your tabs, then the hard-spaced multi-line parts will no longer align.

No, your editor just inserts as many tabs as the initial line had, then spaces over appropriately. This will align properly with any tab setting. I think the real problem with tabs is that so many people use weak editors.

It would be ironic to use tab characters as some kind of magnanimous concession to other developers' preferences while at the same time requiring them to drop their editor of choice.

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

#457
post #415

Earlier quoted context omitted.

Your issue is why you see people say "tabs for indentation, spaces for alignment." If you're trying to vertically align text, use tabs to keep it at the same indentation as the thing you're aligning to, and use spaces to adjust to vertical alignment. This will keep the vertical alignment regardless of the preferred width of the tab.

So for long lines to move an argument over to align with its predecessor on the previous line, like int f() { int someVariableName = myFunctionCall(expr(5), // ...you're saying line A is indented with tabs, and line B with spaces? Because that will misalign if your tab setting isn't the same. Or are you saying that both A and B are indented with spaces? Then what about line C, which will misalign with A and B if your…

[deleted]

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

#458

Earlier quoted context omitted.

I can't believe that in 2017 I'm reading comments containing blatant spacial prejudice on Hacker News of all places.

Hacker News should be a Safe Space.

Just one space?

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

#459
post #434
post #415

Earlier quoted context omitted.

So for long lines to move an argument over to align with its predecessor on the previous line, like int f() { int someVariableName = myFunctionCall(expr(5), // ...you're saying line A is indented with tabs, and line B with spaces? Because that will misalign if your tab setting isn't the same. Or are you saying that both A and B are indented with spaces? Then what about line C, which will misalign with A and B if your…

You indent line A with tabs. You use tabs to line the start of line B up with the start of line A (indentation) and then use spaces to move it the rest of the way to where you want it (alignment).

And as an aside, it's worth pointing out that most editors will handle the initial tab part automatically, so it's not like you have to do mental math to think "okay, this many tabs, and now switch to spaces". Just at the end of line A, you hit enter and start hammering the space bar.
Post reply on HN