Live data from Hacker News

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

stackoverflow.blog

361–370 of 690 posts

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

#361

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…

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

yeah, reading this entire thread shows why spaces is more popular. nobody knows how to use tabs properly.

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

#363

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

I often run into trouble with IDEs that think they are smart, but aren't. "I see you have a space following a tab, so I will replace all your spaces with a tab, whenever you save the file"

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

#365

Earlier quoted context omitted.

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

From the linked issue:

>deliberately have my editor set up to change tab width based on editor width (responsive indentation width)

What editor are you using that has this setting?

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

#366
post #276

Earlier quoted context omitted.

While your comment is obviously meant as a joke, it somehow rings true from my anecdotal experience. I'd also like to see an analysis of space-vs-tabs as it relates to operating systems. Again, from anecdotal experience, it seems spaces are more common for folks with *nix background who tend to work in product-oriented companies (i.e. where code is an asset) and tabs are more common with windows folks, who tend to wo…

I'd like to add my own anecdote: Windows development primarily happens on one vendor's IDE - Microsoft Visual Studio, and where MS leads, Windows-based developer follow. Case in point - I use the default Visual Studio settings which are spaces, BUT they weren't always. I remember as recently as 2008 tabs were the default.

Visual Studio 4-6 (1996-2000) the default was tabs

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

#367
Well, pretty biased article. One example:

"There were 28,657 survey respondents who provided an answer to tabs versus spaces and who considered themselves a professional developer (as opposed to a student or former programmer). Within this group, 40.7% use tabs and 41.8% use spaces"

Without filtering to the 'professional developers', meaning overall, there are more tab users (32% vs. 28%).

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

#368

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.

https://sourceforge.net/p/texstudio/hg/ci/69381fad4634edc4fb...

:(

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

#369
post #230

I see it’s time to once again present the once-and-for-all solution to this tabs/spaces mess: Elastic Tabstops! http://nickgravgaard.com/elastic-tabstops/

Amen, brother! Unfortunately, like fair taxes, truly representative democracy, and peace in the middle east, this is probably an idea that's doomed to be forever ahead of its time.

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

#370

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.

They mean like this, where `-` is tab and `.` is space:

    --def myfunc(
    ---foobar = 1,
    ---...baz = 2
    --)
(silly example, idk, you get what i mean)

No matter what size tab stops you use, the `=` will always line up vertically, because the tabs are only used for the indentation (nesting level), not the visual alignment.

Post reply on HN