Live data from Hacker News

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

stackoverflow.blog

161–170 of 690 posts

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

#161
post #103

Earlier quoted context omitted.

Seems unfair to downvote you just for misunderstanding, that was sarcasm friend.

I strongly think \s should be enforced in every post in HN.\s

You should have escaped the tag, like this \\s. Your second tag closed, forcing people to take your post seriously.

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

#162

I'd rather see the results for those that don't participate in SO surveys: those making $200-500k.

This may or may not be true, but just FYI the salaries were an optional part of the survey so those people may have chosen not to give their salary for some reason or another.

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

#163

Earlier quoted context omitted.

Tabs for indentation; spaces for alignment; I don't know why you'd want to insert tabs in the middle of a line. Also, most people who do have several years of experience under their belt will tell you: don't align. Mid-line alignment is a waste of a maintainer's time to have to update alignment blocks every time you add/remove variables... and statement-alignment is unreadable[1]. [1] https://github.com/pennersr/djan…

> Tabs for indentation; spaces for alignment On a large code base with multiple committers, I've never seen this rule followed consistently. In fact, I think this shows a poor engineering decision: "Let's make a rule where everything looks OK 95% of the time, except when you change tab widths (which is, presumably, why we made the rule in the first place.)"

Well everything looks OK 100% of the time if everyone followed the rule. Sadly, human history tells us that's an invalid assumption to make.

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

#164

Earlier quoted context omitted.

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.

What kind of a dick opens up a tabbed project and starts inserting spaces? Even if you have a preference the other way you play nice with others and stick with the project conventions.

The other thing you need to do is stop people from checking in code that doesn't follow project conventions.

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

#166
post #143

Earlier quoted context omitted.

Tabs for indentation; spaces for alignment; I don't know why you'd want to insert tabs in the middle of a line. Also, most people who do have several years of experience under their belt will tell you: don't align. Mid-line alignment is a waste of a maintainer's time to have to update alignment blocks every time you add/remove variables... and statement-alignment is unreadable[1]. [1] https://github.com/pennersr/djan…

I do find properly aligned code easier to read in general, I'm not willing to give that up. The crux of the issue is poor tooling. Aligning correctly is a pain because most editors suck terribly at it. For instance neither emacs nor vim align correctly when using tabs by default (they use as many tabs as they can and then pad using spaces, instead of indenting only with tabs and aligning only with spaces). If they di…

Yeah; the correct answer to a good codestyle is good tooling; high quality automated tooling. Things like gofmt and prettier are excellent. yapf and clang-format are also pretty good, but need a lot of set up.

But I never found a single editor that handles spaces correctly. I currently use vscode with vim bindings and whenever I deal with a space-indented codebase I want to tear my hair out: I inconsistently have to hit backspace sometimes once, sometimes multiple times to get rid of an indent level in insert mode. And don't get me started with yaml, a really painful experience to edit it.

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

#167

Earlier quoted context omitted.

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)

Tabs for indentation; spaces for alignment; I don't know why you'd want to insert tabs in the middle of a line. Also, most people who do have several years of experience under their belt will tell you: don't align. Mid-line alignment is a waste of a maintainer's time to have to update alignment blocks every time you add/remove variables... and statement-alignment is unreadable[1]. [1] https://github.com/pennersr/djan…

The alignment in that link is laughable. Please use newlines and an extra indentation level.

I believe older versions of Xcode did that by default with objc (maybe still; didn't check lately) if you press enter in the middle of a function argument list. Really annoying.

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

#168
post #70

Earlier quoted context omitted.

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?

Tabs fail when my IDE is set to convert tabs to spaces and yours isn't.

In that case your IDE fails.

Respect .editorconfig files

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

#169
post #42

This does not mean that changing from tabs to spaces will increase ones income. I would expect there simply is a confounding factor that the author did not look at. Maybe the info is not in the data. I can imagine that the space/tab choice is related to the "upbringing" of the developer. Maybe which language or editor they used first in their life. Or maybe it's related to culture. For example when using IRC, tabs ar…

Yes, but since it's a human situation, you can reverse the causality link. Imagine people use spaces for an underlying reason that gives them naturally a higher salary, like Harvard Legacy applicants are taught to use spaces, they don't become wealthy because they use spaces, but because their parents were wealthy. And wealthy people hire the kids of other wealthy people with big salaries. Clearly there is no space =…

It could work if the confounding factor is the one you described. But it would probably backfire if the confounding factor is which language you learned first.

Then forcing yourself to use spaces might reduce your productivity, your self-esteem and your mood.

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

#170

Earlier quoted context omitted.

Tabs for indentation; spaces for alignment; I don't know why you'd want to insert tabs in the middle of a line. Also, most people who do have several years of experience under their belt will tell you: don't align. Mid-line alignment is a waste of a maintainer's time to have to update alignment blocks every time you add/remove variables... and statement-alignment is unreadable[1]. [1] https://github.com/pennersr/djan…

> Tabs for indentation; spaces for alignment; If you try this, it fails for people who use a different tab size than you, which is the whole supposed point of using tabs. But yes, the correct answer is don't align. Utter waste of time.

This entire thread is why I love gofmt so much. I haven't thought about this useless bullshit for years.
Post reply on HN