Live data from Hacker News

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

stackoverflow.blog

201–210 of 690 posts

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

#201
post #123

The reason I use tabs is pretty simple. It's faster to move around only using the keyboard. It's also faster if I'm changing code that requires reformatting. Finally, when another developer looks at the code, their IDE will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc. In other words, it adds flexibility. Brace yourself: I use two spaces after the end of sentences too. [1] I am quite the rebel.…

> Finally, when another developer looks at the code, their IDE will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc. In other words, it adds flexibility.

This is exactly why I use tabs and the reason which appears to never get cited in the holy wars.

People who use spaces want to line up their '=' signs, that's fine, but I don't believe it's my position to enforce the amount of whitespace another developer has to use in their editor. It's an accessibility thing, they might have their font size really large because of eyesight problems in which case 8 spaces is going to make reading the code a lot harder.

The fact that Python's rule used to be 8 spaces, then got changed to 4 thereby invalidating old code really showed me how shortsighted it is to use a set number of spaces in a whitespace sensitive language.

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

#202
post #123

The reason I use tabs is pretty simple. It's faster to move around only using the keyboard. It's also faster if I'm changing code that requires reformatting. Finally, when another developer looks at the code, their IDE will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc. In other words, it adds flexibility. Brace yourself: I use two spaces after the end of sentences too. [1] I am quite the rebel.…

Don Knuth seems to agree with you a bit; TeX automatically inserts some extra spacing between the end of a sentence and the beginning of the next one. (But the extra space is less than one full inter-word space.) You don't have to type it yourself though!

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

#203

Well, of course. Only companies with fuck-you money can afford the extra bytes spaces take up versus tabs, so it follows logically that they'd pay their developers more.

Well, white-space is removed anyway in compressed production files...

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

#204

Might also be that the space people, being irritatingly pedantic also include bonuses and/or stock compensation , while the tab people, always lazy and all over the place, just barfed the first number that came to mind. The answer, as always, is: lisp with parinfer - makes the whole debate irrelevant.

A counter answer: C is not lisp, why should it be indented with spaces like lisp?

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

#205
post #30

As a spaces user, I have to acknowledge that I get irritated when I open a document with tabs and the formatting is messed up thanks to tab setting mismatches. Is it possible that tab-aversive people making hiring decisions act on their aversions (consciously or unconsciously), while tab-friendly hiring managers do not?

Can you explain that? I can't see how different tab settings would mess up formatting. Unless you use tabs to match the position of things over two different lines (which is abusing tabs), or mix spaces and tabs, tabs should work fine.

It is usually frowned upon when people's excuse is "You are holding it wrong".

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

#206

Earlier quoted context omitted.

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 indent…

Actually they all boil down to 'someone else, or another IDE that you haven't configured just right, will mess your tabs and make the code hard to read' :) They're fine for solo projects i guess, if you only ever use one editor. Edit: Also, in the long run the best thing you can do to your code is to make it easily readable. You will forget what you did. Not to mention your colleagues that have never seen it. So time…

I think you've just figured out why people who use spaces get paid more: they spend more time aligning the code nicely :D

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

#207
post #123

The reason I use tabs is pretty simple. It's faster to move around only using the keyboard. It's also faster if I'm changing code that requires reformatting. Finally, when another developer looks at the code, their IDE will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc. In other words, it adds flexibility. Brace yourself: I use two spaces after the end of sentences too. [1] I am quite the rebel.…

> when another developer looks at the code, their IDE will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc.

This is an argument I hear often from tab proponents. What it misses out is the downside: my IDE has a certain arrangement on my screen, and I'll either have to invoke horizontal scrolling or I'll have a bunch of wasted space if you are using different size tabs from me. This is far from flexible.

There's also the (more minor) issue that you then can't line things up on a line below at an arbitrary place if the indentation of the two lines is to be different. This is admittedly less of an issue, but it does arise on the occasion one wants to structure text, for example in a table in a comment block.

I've come to the conclusion that the only sensible tab width is 8, since that works everywhere including in tools where it isn't practical to set (eg. less). Further, the only sensible screen width is 80 characters, since that also works everywhere. But I'm not writing this to get into a holy war; only to point out that the "it adds flexibility" in your argument is a fallacy.

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

#208
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 indent…

With the spread of autoformatters which automatically format or reformat your code, I don't even know or care what kind of indentation I use anymore. In all the languages I use, it's out of my hands.

Examples of autoformatters:

YAPF for Python

Gofmt for Go

Rustfmt for Rust

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

#209
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 very hard to parse in most languages, so I don't want that affecting me if I can get away with it. While this is possible with spaces and maybe a series of Git hooks, it's trivial with tabs.

On the other hand, I always use spaces in languages like Python or Ruby where there are well-codified style standards. I also always show invisible characters on any editor which allows it, and have cleanup scripts to ensure that whitespace is standardized across any non-vendor code in the project.

Maybe most tab users don't feel this way? Maybe most aren't as careful/picky as I am? Maybe tabs are more popular with younger devs? But I feel like tabs can offer more interoperability than spaces when many coders are working on the same project when the language/community doesn't strongly specify whitespace.

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

#210

>Developers who use spaces make more money than those who use tabs Sure, but how many spaces? grabs popcorn

Anything less than 16 is literally blasphemy, in the modern world everyone is using 4k 32:9 monitors and for the best level of readability heavy indentation may as well be mandatory.
Post reply on HN