Live data from Hacker News

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

stackoverflow.blog

211–220 of 690 posts

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

#211
post #102

Earlier quoted context omitted.

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

Additionnaly diff/merge tool tend to be inconsistent. So it looks good on your editor, but when I am doing your code review, alignement is totally broken. In theory, it should be easy enough to ask people to have consistent settings across all tools, but it is a bit like herding cats. Sadly most people do not even realize it could look differently without their settings. (I could ignore whitespaces when doing reviews…

Seriously? When you start on a project you configure your IDE to match the project's conventions. If you are in a mentoring role you instruct your jr developers to do the same, first thing, before writing any code. This has never been an issue at any place I ever worked. If a PM can't get their developers to do something as simple as that then you have larger organization problems than code formatted weirdly. As well as totally incompetent developers.

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

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

Tab is usually three spaces, right? So if I hit the tab key, I'm getting three button presses for the price of one. So extrapolating from that, if I hit tab I can get my work done three times faster and get out of the office quicker. If I'm using space, it takes me three times longer, which makes the boss think I'm working three times harder and I get a pay raise. I'm always at the office before she is (to fill in all the spaces) and I'm at the office after she leaves (still jamming that space bar). Sure the guy who uses tab ships code faster, but it must be worse code because he obviously rushed through it.

It looks good that I'm such a hard worker. So I get paid more.

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

#214
post #100

Earlier quoted context omitted.

It's pretty much an unwritten rule that a sarcastic joke on the internet with sufficient exposure will get a response by someone who didn't get it. Using /s really kills the fun (and whole point) of using sarcasm so it's a trade off to accept these comments will happen. I'm impartial to downvoting as to reply literally doesn't usually add to the conversation, which is generally the point of downvoting. Losing karma s…

Do you mean partial to? As in, you favor downvoting over commenting to point out their mistake? Don't mean to be nitpicky, just genuinely confused if that was a mistake or I'm misunderstanding.

I meant that as I'm indifferent to whether or not they get downvoted but I see there could be a justification for doing so.

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

#215

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.

> If you try this, it fails

If it fails, then you have not understood and you are not using your tools correctly. If your alignment depends on tab width, then you are not using tabs for indentation and spaces for alignment, you are using tabs for indentation and alignment and spaces for alignment, which of course breaks when you change your tab width.

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

#216

Earlier quoted context omitted.

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.

Oh, I've got some good examples :D

https://github.com/ioquatix/rack-freeze/issues/2 https://github.com/ioquatix/latinum/pull/1

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

#217

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…

"As someone who slightly prefers tabs" ... "I generally prefer tabs"

wat

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

#218

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.

I have never seen this work correctly in practice, where a code base with tabs looks "OK" when opened on an editor with a different tab width. E.g. some coding styles will have subsequent lines line up (like multiline method params), and everything looks horrible with a different tab width. If anyone can post a sizable production code base that uses tabs that DOESN'T look like shit with a different tab width, I'm cer…

FreeBSD, Linux ... every UNIX kernel codebase ?

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

#219

Earlier quoted context omitted.

That's the reason I use tabs for indentation? 4 spaces will render as 4 spaces, 2 as 2. 1 tab will render to whatever the next programmer prefers, it's only courteous.

It's courteous except to those that don't like tabs, so you really can't win. Many languages have a coding style preference. Go is super opinionated, Python in the middle, with C being as conflicted as it gets. Whatever you use, follow the style the language or team is a proponent of.

If you don't like tabs, converting them to spaces is trivial. You could even add git hooks to do it automatically.

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

#220

Earlier quoted context omitted.

> 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.

> If you try this, it fails If it fails, then you have not understood and you are not using your tools correctly. If your alignment depends on tab width, then you are not using tabs for indentation and spaces for alignment, you are using tabs for indentation and alignment and spaces for alignment, which of course breaks when you change your tab width.

[deleted]
Post reply on HN