Earlier quoted context omitted.
> Don't think you make hiring decisions based on tabs vs spaces? I actually ask candidates "spaces or tabs?" in every single interview. I don't really care what the response is in regard to the holy war, and it doesn't mean anything on its own, but having SOME thought out response can be a GREAT indicator of how well versed someone is in general. e.g. I'm going to think way more highly of someone that says "tabs, bec…
> 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.
Developers who use spaces make more money than those who use tabs
341–350 of 690 posts
Re: Developers who use spaces make more money than those who use tabs
#342Earlier quoted context omitted.
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
#343The 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.…
> when another developer looks at the code, their IDE will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc. This is an argument I hear often from tab proponents. What it misses out is the downside: my IDE has a certain arrangement on my screen, and I'll either have to invoke horizontal scrolling or I'll have a bunch of wasted space if you are using different size tabs from me. This is far from fle…
I'm curious. Where does 80 characters not work now? How many people / industries are still using green-screen terminals with a fixed-width of 80 characters?
I'm generally in favour of enforcing line-wrapping requirements, because I've worked with people that would have a tendency to write code that trails off the end of the earth if you let them. But I haven't seen a good argument for 80-character line limit other than "that's the way it's always been done."
I realize that the 80-character limit is "everywhere"[1], but other than "it's everywhere" is there a more solid reason?
[1] When editing text emails in Vim the default textwidth value is 72, so that there is still some flex for quoting explicitly wrapped text (i.e. prepending "> " to the lines) and staying within the 80-character limit. The "official/accepted" git commit message format limits the commit message title to 50 characters, and the message body to ~80 characters. etc...
Re: Developers who use spaces make more money than those who use tabs
#344The 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.
Re: Developers who use spaces make more money than those who use tabs
#345Earlier quoted context omitted.
Yeah, it can start some interesting conversations too - I don't care personally and tend to go with whatever autoformat in the editor uses. My view is that formatting code shouldn't be a human's job, adding linebreaks on long lines, spacing things out to exactly line up, etc is just a waste of my time. That's the computer's job - it should do it based on human readability rules though, clang-format is probably the be…
Wow, I am a spaces guy but honestly, didn't care this much. Clearly, I should! I mean, I would have failed that interview question totally. Except, I would have said whatever the team consensus was.
Re: Developers who use spaces make more money than those who use tabs
#346Re: Developers who use spaces make more money than those who use tabs
#347Almost certainly a result of the spaces cabal and the (often unspoken of) prejudice against tab users. Don't think you make hiring decisions based on tabs vs spaces? Well you're part of the problem, then. I'm building an app to help you easily email your congressperson and ask them to create legislation requiring space/tab equality. This has to stop. Please consider donating to my Patreon.
> Don't think you make hiring decisions based on tabs vs spaces? I actually ask candidates "spaces or tabs?" in every single interview. I don't really care what the response is in regard to the holy war, and it doesn't mean anything on its own, but having SOME thought out response can be a GREAT indicator of how well versed someone is in general. e.g. I'm going to think way more highly of someone that says "tabs, bec…
Re: Developers who use spaces make more money than those who use tabs
#348This 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…
- "TABS WORK GREAT FOR ME" -> First-order effect
- "If someone else views this file with a different tab width preference, the indenting will match their preference" -> Secondary effect
- "If users' preferences can change the indenting of a file, then vertically aligned elements will align or misalign depending on who's viewing it and who wrote it." -> Tertiary effect.
- "Randomly broken formatting and/or forcing users to constantly change their personal tab preferences is a bad way to work with code" -> Quaternery effect, etc.
In other words, a whole-system view that accounts for interactions with other decisions might lead you toward using spaces, while an immediate "local" view might lead you to choose the thing that seems most convenient right now.
Re: Developers who use spaces make more money than those who use tabs
#349Earlier 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…
I do it myself but it requires a bit of maintenance and I wouldn't trust teammates with it. There will always be some guys who don't understand the idea and mess everything up.
In a team environment, now, I wouldn't chose anything but 4 spaces. Speaking from experience.
- with anything but 2, 4 or 8 spaces, some guys with incorrectly set up editors will mess everything up.
- tabs don't work well for alignment, and as long as you allow the tab character, someone will make a mess.
- 2 spaces is not enough to properly distinguish between blocks.
- 8 spaces can look very nice if your code is very clean. It won't be the case of your project.
Re: Developers who use spaces make more money than those who use tabs
#350I 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…
If everyone used tabs perfectly, I'd be fine with them...