Live data from Hacker News

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

stackoverflow.blog

471–480 of 690 posts

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

#472

I used to work at a place where a huge argument occurred between staff, fighting over tabs vs spaces. It wasn't mentioned in the company code style. Eventually leadership got annoyed at the amount of time developers were wasting punting code reviews back and forth over this silly nonsense, let alone the loud altercations around the office. Who ever could have guessed that developers would be such an opinionated bunch…

I can't believe I read that all the way to the end. Well played.

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

#473
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…

I think he's saying use tabs on lines A, B, and C up until the indentation level (the "int"). Then on line B use spaces for all the whitespace from there until the text is aligned.

    /*t*/int f() {
    /*tabs*/int someVariableName = myFunctionCall(expr(5),          // 

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

#474

Earlier quoted context omitted.

Known as Poe's Law [1] [1] https://en.wikipedia.org/wiki/Poe%27s_law

I will don't understand why it's called Poe's Law if he said it in 2005. This phenomenon was well documented on Usenet by the early nineties.

Known as Stigler's law.

https://en.wikipedia.org/wiki/Stigler%27s_law_of_eponymy

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

#475

Earlier quoted context omitted.

It's not really prejudice if those 'tabbies' are just inferior, is it?

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

It happens with the best of us. Even Thomas Jefferson used spaces when drafting the Declaration of Independence, despite being an outspoken tabs supporter.

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

#480
post #314

I see a few arguments here which suggest people think tab-users might care less about their code and/or their fellow coder. As someone who slightly prefers tabs and abhors mixing of tabs/spaces, I find this frustrating. I generally prefer tabs because I feel that they're more egalitarian: I like 4-space indentation, but don't want to force that on everyone encountering my code. Similarly, I find 2-space indentation v…

Using tabs has the opposite of your intended effect: If there is any text which is vertically aligned beyond the first indent, then this alignment will break for anyone who doesn't have your tab width preference. They're then forced to change their editor settings to view your file in a non-broken way. I get way more pissed about someone else "forcing their preferences on me" when this happens than when I run into a…

This is another style thing, I think. When writing Objective-C I always use spaces because lining things up is idiomatic to the way the language is written. Same with Python which has well-codified style rules for many multi-line argument lists and the like. However, beyond that, I don't tend to line up assignments or anything else that has me doing indenting with spaces AND tabs, so (at least with my code) this doesn't end up being an issue.

If I was working on a project where there was a strong preference for indenting assignments, or any other case like this, I would use spaces throughout.

Post reply on HN