Live data from Hacker News

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

stackoverflow.blog

171–180 of 690 posts

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

#171

Is this about whether you set your editor to convert tabs to spaces? (which is obviously tidier due to inconsistent treatment of tabs) Or do some people actually use the space bar to indent code? (which is obviously insane)

Definitely the former. Anyone who indents there code by slapping the space bar repeatedly is a monster and should have their hands cut off.

Then this survey is surely measuring awareness of how editors work. Most code editors substitute spaces by default.

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

#172
post #27

Earlier quoted context omitted.

Where does using vim to insert four Spaces everytime I press tab leave me?

Yea, I'm honestly surprised this is a thing still. I've not thought about the tab vs spaces "war" in years; because of Vim. I just hit Tab and whatever the pre-defined standard is, be it tabs or spaces and space count, is used. Visually I can have it display in my editor of choice (Kakoune at the moment) however I want. I guess I'm just saying, I would have thought the most common answer to this question would be: Wh…

i'm surprised people manually insert tabs/spaces. vim automatically indents for me and even if it didn't, formatting the code is one keybind away...

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

#173
post #143

Earlier quoted context omitted.

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…

Can't vscode automatically remove an entire indentation level with a single backspace? Many editors can do that, maybe with a non-default setting, but regardless.

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

#175

Am I alone in not even knowing what I use? I use the formatting standard that my IDE enforces.

Use the arrow keys to move around a bit. Does it move once space at a time or jump?

This depends on how the editor works with spaces. it could have a special rule for '^\s*'

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

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

Any coding standard that relies on humans to do something right is going to fail. Tabs might work if there was a way to automatically enforce no alignment and no use of spaces. But I've never seen any organization actually do that.

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

#178
Somehow it doesn't surprise me that much. Software development is ridden with fads that fastidious, obsessive developers make a point of adopting enthusiastically (they used to call them "best practices" until somebody even more fussy came and suggested to call them just "good practices", because "no practice can be universally best").

These people have a particular gusto in constantly one-upping each other with the latest good practice; the one that adopts the highest number of good practices wins. Their constant talk of the latest fad and push for the "right ways" of doing things usually puts them in positions where they end up evaluating and hiring new developers (I got interviewed just the other day by somebody that didn't ask me to design or structure any code, but rather if I use == or ===).

Some of these are actually excellent developers nonetheless; others will drive entire teams into rewriting a perfectly working application into a completely useless mess of a thousand microservices. Endeavour that will end up in their CV anyway, helping them to find another excellently paid job once it's time to migrate.

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

#180
post #83
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?

They might be configured differently, and you usually can't align stuff properly using just tabs, you have to use a space or three somewhere. Also, you never know if it's spaces, tabs or a combination of them in existing code - which you may have not written yourself. So in the long run, the indentation WILL get fucked up and you WILL miss something when fixing a bug in code that you or someone else wrote 6 months ag…

>you never know if it's spaces, tabs or a combination of them in existing code - which you may have not written yourself.

Um... I always know because I always set my IDEs to show those characters. You don't?

Post reply on HN