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: 2) by vux984 on Sunday June 18 2017, @07:26AM (2 children)
Pretty much.
No. Spaces are simple, standard, well defined, well understood, and portable. They occupy one space, like every every other normal character. And a one space separator is highly desirable. And the only way to emulate spaces with tabs is to define tabs as one space, which is what a space is; so its an absurd reduction. Conversely, you can easily emulate tab stops and tab functionality with spaces. It is ridiculous to suggest that there is nothing to favor one over the other.
(Score: 2) by acid andy on Sunday June 18 2017, @09:50PM (1 child)
As are tabs.
Only when using a mono-spaced font.
Sometimes. But no-one's suggesting destroying the Space Bar.
Not really. You could define a tab as a different number of spaces in your editor. It all depends on personal preference and how much text you want to fit on one line of your screen.
Sure, you can but it becomes irritatingly inconsistent the minute you have to bring in code from another project or programmer that just happens to use a different number of spaces to you to represent an indentation. Spaces potentially allow more inconsistency than tabs when used for code indentation.
Also, if you indent with spaces, some simple editors might not allow you to decrease the indent as quickly by pressing Backspace as with a tab. One press of Backspace deletes a whole tab, but if there are four spaces per indent, it takes four times as many key strokes. I'll grant you this isn't an issue most of the time as Shift-Tab usually works.
If a cat has kittens, does a rat have rittens, a bat bittens and a mat mittens?
(Score: 2) by vux984 on Monday June 19 2017, @05:51AM
LMAO. Can you really say that with a straight face? Tabs are not well defined; editors treat them differently, and they are highly configurable;... that's the opposite of 'simple, well defined, and portable'. How much special programming in the editor is required to handle spaces? About the same amount as the letter 'A'... which is to say none. How custom logic to handle tabs? Tabs are pretty much the LEAST simple character used in source code.
That's true. Does anybody use proportional space font for source code?
The post i was responding too was.
The context here was someone saying not to use spaces ever, only tabs. Defining a tab as a different number of spaces, requires you to use spaces.
The code you are pasting in from another developer somwhere else, could potentially use spaces OR tabs OR both. Only the possibility of there being spaces is not going to result in 'more inconsistency' ... at worst it'll be the same.
Decent editors can reformat code on demand. Except for python.
Don't use crappy editors. Some crappy editors won't cope with CR/LF issues, or unicode... either.