Submitted via IRC for TheMightyBuzzard
The annual Stack Overflow developer surveys often include lots of bad news. "People still use PHP," for example, is a recurring and distressing theme. "Perl exists" is another.
But never before has the survey revealed something as devastatingly terrible as the 2017 survey. Using PHP and Perl are matters of taste. Extremely masochistic taste, certainly, but nobody is wrong for using those languages; it's just the programming equivalent of enjoying Adam Sandler movies. But the 2017 survey goes beyond taste; it goes into deep philosophical questions of right and wrong, and it turns out that being wrong pays more than being right.
Developers who use tabs to indent their code, developers who fight for truth and justice and all that is good in the world, those developers have a median salary of $43,750.
But developers who use spaces to indent their code, developers who side with evil and probably spend all day kicking kittens and punching puppies? Their median salary is $59,140.
Source: ArsTechnica
(Score: 5, Insightful) by darkfeline on Sunday June 18 2017, @04:37AM (8 children)
It's silly how many people think tabs are for indentation. Tabs are for making TABles, that's why they're called TABs.
Tabs do not have an adjustable width. The tab character means to move the cursor until the next tab stop.
Tab keys were for present on typewriters for making tables. They were (ab)used for indentation because pressing tab is literally identical to pressing the space bar multiple times. There were no whitespace characters inserted onto the paper.
When computers came along, the tab character was still used for making tables (e.g., Tab Separated Values), but it was continued to be used for indentation because teletype machines are just typewriters, there was no difference between a tab and multiple spaces after the teletype got it, and the tab saved bits back when they actually mattered.
Nowadays, the only people still using tabs for indentation are a few groups of ignorant people:
1. People who think indenting with spaces means pressing the Space bar multiple times.
2. People whose text editors aren't capable of reindenting code indented with X spaces to Y spaces ("I can just adjust the tab stop interval instead!")
Or in other words, people still using 1990s era tools. Sure, if you're using a 50 baud teletype, by all means use tabs and save yourself the extra half second.
Join the SDF Public Access UNIX System today!
(Score: 0) by Anonymous Coward on Sunday June 18 2017, @05:18AM
Tabs do not have an adjustable width.
Not on any typewriter I ever used. Almost every single one was adjustable. Almost every software editor somewhere usually has the space length of a tab (usually defaulted to 8, though I am starting to see 4s). All the way back into the 80s. I usually set mine to something 'odd' like 15 to pick out the files that are formatted badly. Then correct the programmers setup. We have a style guide and you better stick to it. None of this 'we are professionals' BS. This used to be a pain depending on which printer you used too as some of them did have fixed length and if your editor mismatched you ended up with a crap printout.
Tab stops were also used for center/right alignment/left alignment/first sentence in paragraph alignment/etc. Depending on how you configured your stops. Not so much anymore as the editors are better at it with style codes.
People who think indenting with spaces means pressing the Space bar multiple times
Which is exactly how I end up using it as for some reason most programs seem to default to tab emitting 1 tab char instead of x spaces. I can configure it but after awhile of jumping from computer to computer and app to app it becomes a pain. So tap the space bar a few times. But thank you for your generalizing sweeping statement of how 'ignorant' people are that do not agree with how you do things.
(Score: 4, Insightful) by Arik on Sunday June 18 2017, @08:20AM (5 children)
I was wondering if you had ever seen a typewriter, thanks for confirming the no.
Of course tabs have adjustable width. Typewriters had these things called tab stops, you can move them right or left any way you needed to get your indentation levels correct. This is even easier to do with a modern text editor. Even freaking Word lets you set tab stops.
Spaces are for separating words. Tabs are for indentation. Just because neither of these things deposits ink on the paper does not make them the exact same thing.
If laughter is the best medicine, who are the best doctors?
(Score: 0) by Anonymous Coward on Sunday June 18 2017, @08:54AM (4 children)
What editors do you know that allow for arbitrary tab stops? The only one I know that actually allows that is Emacs, all others only allow to set a tab interval, not every tab stop individually. And please do mention code editors -- Word is not a code editor (and it knows that -- even if you edit VB macros in Word itself, it spawns a different editor).
(Score: 2) by rleigh on Sunday June 18 2017, @10:21AM (2 children)
Tab stop settings are a property of the output device, i.e. the terminal emulator or printer, just like physical stops on a typewriter. Some provide escape sequences to set them, others have configuration settings on their setup screen, some are fixed. When using an editor on these, they should use the terminal settings, unless they ignore them and fake it with spaces or direct positioning escapes.
Graphical editors worth their salt allow flexible configuration also, some are limited to multiples of a number, others are fixed.
I ended up moving to spaces, in practice it's less problematic when working on a shared codebase with others.
(Score: 2) by Whoever on Monday June 19 2017, @06:15AM (1 child)
1. Who prints source code these days?
2. The width of a space is also a property of the output device.
(Score: 2) by Arik on Monday June 19 2017, @07:18PM
Output devices include monitors and screen readers, so the answer is anyone that reads it.
If laughter is the best medicine, who are the best doctors?
(Score: 1) by Arik on Sunday June 18 2017, @02:28PM
If laughter is the best medicine, who are the best doctors?
(Score: 0) by Anonymous Coward on Sunday June 18 2017, @07:43PM
Seriously? So if I prefer different tabsize than someone else working with the same codebase, it makes sense to reindent it for my style when editing and then re-reindent it back before committing? And this is somehow easier and "properer" than just using tabs which simply take care of the problem (unless someone happens to be running visual studio which happily inserts space-indented code despite being specifically requested not to do that)?
Alternatively there are either 14 million different text editors which are capable of doing that transparently and I'm ignorantly not aware of them or it may be that whatever you happen to be using does it while having some other downsides and everyone who has an issue with those is "ignorant".
Who do you think you are? Michael Jackson?