Live data from Hacker News

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

stackoverflow.blog

351–360 of 690 posts

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

#351

Earlier quoted context omitted.

I agree with you and kinda wish people would take a combined approach. Tabs are better for indentation preferences. Spaces ensure that everyone sees the same thing, which can help in multi-line situations. So I wish people would avoid this black-and-white discussion. Use tabs for indentation, and spaces for multi-line alignment...

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.

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

#352
post #131

Earlier quoted context omitted.

>you usually can't align stuff properly using just tabs Huh? Things indented to 1 tab will align with everything else on 1 tab. Things aligned to 2 will align with everything else at 2 tabs. >you have to use a space or three somewhere Why? Tabs will indent with other tabs. >you never know if it's spaces, tabs or a combination of them in existing code Well they should never be combined for indentation. Unless you mean…

Oh god. I also prefer tabs, but if a file has a choice of tabs or spaces, never change the whole thing to what you prefer. Always keep it as is.

Good point, in my case that's just how I work on it, git magic converts it to whatever matches the repo style before it's committed.

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

#353

= Why Grown-Ups Don't Use Tabs = * Joe likes 4-space tabs, I like 2-space tabs, and Jane is old-school with 8-space tabs. * All goes well until someone aligns something visually, like so: void someNiceMethod( [tab][tab][tab][tab][space][space]int myParam...); * Now it aligns perfectly on my machine, looks mostly ok on Joe's machine, and is ON MARS on Jane's machine. Thus one-or-more of three futures happens: * Someon…

There's actually a solid argument for "tabs for indentation, spaces for alignment", which solves both for preference and vertically aligning stuff:

  [tab]void someNiceMethod(
  [tab][space*20]int arg1
  [tab])
But it basically requires having some visual indicator of what is a tab, which most people don't like.

(edited for line breaks)

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

#354
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.…

If you're looking for efficiency for text navigation/editing you should consider learning vim/using vim mode in your editor.

Every editor made for coding supports moving through whitespace with a single command.

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

#355
post #328

Earlier quoted context omitted.

> having SOME thought out response can be a GREAT indicator of how well versed someone is in general. Did you cross-check this against any other measure? I can see it going both ways - maybe someone who saves their attention for more important matters would be better at producing value than someone who cares about such minutiae.

yea, thats why I specified "and it doesn't mean anything on its own,"

So how can it be a great indicator then?

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

#356
I don't understand how people can work with spaces. I had to reformat a colleague's query the other day and it was infuriating because all the tabs had somehow been converted to spaces. I had to edit it line by line instead of being able to easily shift entire blocks in either direction.

Do Visual Studio and SSMS support the space equivalent of "Select X rows and tab them all at once"? I just tried now and all the code is wiped out, replaced by a single space.

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

#358
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.…

> The reason I use tabs is pretty simple. It's faster to move around only using the keyboard.

Well, yes, if you use the arrow keys (unmodded) and nothing else. But who does that? Even Notepad lets you jump from word to word with CTRL-left/CTRL-right. Sublime Text must have something similar, surely?

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

#359

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.

I think that a rational sounding inerpretation can be found: all spaces means python programmer (mixing spaces and tabs messes up the indentation), python rulez, therefore high salary

Spaces over tabs is the default for IntelliJ. Given there are over ten million Java developers who are in very high demand, Python is practically a rounding error.

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

#360

= Why Grown-Ups Don't Use Tabs = * Joe likes 4-space tabs, I like 2-space tabs, and Jane is old-school with 8-space tabs. * All goes well until someone aligns something visually, like so: void someNiceMethod( [tab][tab][tab][tab][space][space]int myParam...); * Now it aligns perfectly on my machine, looks mostly ok on Joe's machine, and is ON MARS on Jane's machine. Thus one-or-more of three futures happens: * Someon…

Who aligns like that? It seems to defeat the purpose of putting it on a separate line.

  void someNiceMethod(
  int myParam...
  );
Hey Presto! You, Joe and Jane all get your preferred size size of tab.

As a bonus, this indentation style works equally well if Jim uses a non-fixedwidth typeface.

Post reply on HN