Developers Who Use Spaces Make More Money Than Those Who Use Tabs (stackoverflow.blog)
An anonymous reader writes: Do you use tabs or spaces for code indentation? This is a bit of a "holy war" among software developers; one that's been the subject of many debates and in-jokes. I use spaces, but I never thought it was particularly important. But today we're releasing the raw data behind the Stack Overflow 2017 Developer Survey, and some analysis suggests this choice matters more than I expected. 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 (with 17.5% using both). Of them, 12,426 also provided their salary. Analyzing the data leads us to an interesting conclusion. Coders who use spaces for indentation make more money than ones who use tabs, even if they have the same amount of experience. Indeed, the median developer who uses spaces had a salary of $59,140, while the median tabs developer had a salary of $43,750.
Pied Piper proves it too, that tab loving company is one money losing screwup after another.
eom
StackOverflow is full of people who can't actually code.
Does that means that i make half as much as a developer that uses 4 spaces?
"considered themselves a professional developer" ... "with 17.5% using both"
wtf? a professional developer uses both? really?
if and when i find a file that has mixed spaces / tabs, not only that, but 3 spaces instead of 4 then a tab for the fourth character. I slap that dev so fast the dev will try to rewrite git history.
Proof: neither side makes jack-shit as a coder
Damn, that's starting wages for someone right out of school! Maybe I should stop using tabs AND spaces.
If the median salary was under $50k, then I'm not sure who they were surveying, but it wasn't professional developers.
https://www.eff.org/https-everywhere
Those idiots take four times longer or more to indent their code compared to those of us who use tabs and get home earlier thus working less hours.
#DeleteFacebook
if you create more code you did more work. Using spaces is basically creating 4-8 times as many code as with tabs
I am going to try adding a 0 to the end of all my lines and see if it increases my salary 10-fold.
You're supposed to adopt to the coding style of the project you're working on.
Using spaces increased my earnings by 4x over tabs.
I press tab but the editor inserts whatever the project requires. Did the question account for this?
Correlation is not causation.
Mr. Hu is not a ninja.
Some developers have more space to hold money, and TAB, when you can even find it is expensive.
Why is it so hard to only have politicians for a few years, then have them go away?
But seriously, the causation might go in the other direction?
Entry-level web developers with a 4-year degree get over 60k, and these sorts of offers have to be made after barely confirming a pulse much less any keyboard skills. I could imagine they don't know what a tab character is since there isn't really much use for one on a smart phone and tabs versus spaces don't really render differently in your typical web page.
To be accepting 43k in this decade, I imagine the hiring environment might be so regressive that you also had to use punch-cards in your school work.
If you're using two spaces, you probably work at Google. Do they dock your pay for using extra spaces?
If the salary data is based on after-beer costs, then of course those using tabs are going to be worse off...
I'd think that space vs. tab use is highly dependent on which programming language you're using, and I'd also think that language is correlated with earnings, so I highly doubt this conclusion (if they're trying to conclude anything). Correlation is not causation.
"I have never let my schooling interfere with my education." - Mark Twain
I'm going to start using 8 spaces indentation and ask for a raise (i'll report back about how it goes)
One thing has nothing to do with the other.
No, what it means is that the major tech companies that employ a lot of people, and pay a lot of money all have coding guidelines that say to use spaces.
I know for a fact the two very big ones use WebKit's style guide as a basis for most of their work, and that it asks you to use spaces.
All of my editors do it for me.
I used to be religious about using a 2 space indent, but I no longer program in Python, so, now, who gives a flip?
Now I just want my code to look good. In Visual Studio, I do Ctrl-A, Ctrl-K, Ctrl-F, and I don't even know if it does tabs or spaces, and I don't care.
Also, I agree that those surveyed are incredibly underpaid.
- I live the greatest adventure anyone could possibly desire. - Tosk the Hunted
I use only fingers to develop Appy apps !
Anybody dare try a study about in code comments and Salary levels?
My guess is you will see the same difference between Emacs and VI users...
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
I use tabs and I understand some people prefer spaces but what kind of hybrid-hell-beast uses both??
Use Notepad++ and just convert all the Tabs to 4 spaces so they get paid more and work less ...
Modern IDEs format code automatically and use spaces or tabs based on your settings. In addition, the auto formatter automatically adds whitespace when you go into the next line. It is most likely not a real dependency between whitespace and salaries, but it has more to do with which environment they use.
Let's say that using spaces was taught in the 70s, while tabs was taught in the 80s.
Now let's say we ask people for their style and their income. The older programmers that by now make more money will say they use spaces, while the younger programmers will say tabs. This would account for the differences.
In short, this survey isn't providing enough data to control for any factor, and the likelihood that tabs and spaces actually impact the earnings of any programmer is 0.
Also, any programmer that uses spaces is going to Hell (which runs Windows ME on the user machines)
Most of the respondents wouldn't have understand the question because they actually use whatever their IDE does.
I read some of the comments expecting amusement, I was not disappointed. One specifically thought spaces-favoring developers were using the space bar rather than the tab key.
How much money do developers who let their damn IDE do the indenting for them make? :)
Have gnu, will travel.
Programmers who use spaces are more likely to lie about how much money they make.
Support Right To Repair Legislation.
There is a lot of questions out there, that these numbers don't seem to show.
1. Which languages do they use primarily. Python for example while can handle tabs, your code needs to be consistent so using spacing is better. Normally you also set the IDE to replace tab with spaces. Other languages that don't care about white space may allow tabs and spaces to be mixed.
2. What type of projects are they working on. Larger projects with mutable developers need to keep their coding style more or less synchronized. Space intents are normally preferred as tab spacing will be inconsistent across system settings.
3. Is this based on code review. If so, does the IDE just replace Tabs with spaces.
I myself am normally will follow the Tab key, with the IDE replacing it with spaces. As the Tab takes one keypress and makes jagged ends often move to the correct tab point (Still an IDE thing)
If something is so important that you feel the need to post it on the internet... It probably isn't that important.
This is probably an excellent example of where cause and correlation are not the same thing.
Here is my suspicion, as an old programmer. The REASON why spaces are encourage over tables is for consistency of printing on a physical paper.
Which is unimportant or irrelevant if you are not. a) doing code reviews where you are passing out dead tree copies like may have been done 10 to 15 years ago OR b) submitting source code formatted on word docs as some part of documentation to a customer as government contractors are some times required to do.
SOOO.... my hypothesis is that most people who regularly used spaces and were trained when it matters are either senior developers ( who tend to make more money) or working in government contracting, thus being the cause of the correlation noticed in the study. Of coarse without gathering enough data to control for the those variables you cannot have certainty of the answer. The original post doesn't include age of developer in it's data set as near as I can see , which to me is a obvious omission if you want to actually say anything useful about salary vs habits as many habbits will track with 'when' you trained.
âoeTolerance applies only to persons, but never to truth. Intolerance applies only to truth, but never to persons.
For true "Holy War" status it must compare salaries of vi vs. emacs users.
https://www.youtube.com/watch?...
You don't use science to show that you're right, you use science to become right.
Get off of my white space and take your TAB cola with you!
Sure, if you sell your soul to the devil you can make a ton of money working for the Banksters or the Military Industrial Complex.
Am I late for the holy war?
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
Well, I do use two spaces, and I make no money at all. No idea what I'm doing wrong, if it isn't the spaces!
If spaces are so great, why not make it more of a default in text editors and IDEs? When I get a new machine or start using a new tool, I might write a whole bunch of code using the default tabs, then realize that my Python interpreter complains about mixing tabs and spaces.
Anyone else find the salaries rather on the low side?
One space or two after a period?
Sorry wrong crowd :P
(and don't you heathens dare say one)
Using spaces to indent is really kind of an OCD thing to do. There's the time and the counting and then redoing when you change something.
So maybe the real lesson is the OCD programmers make a bit more than non-OCD programmers.
When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
No idea what I'm doing wrong, if it isn't the spaces!
If you grew up on typewriters, two spaces between sentences was the norm. A habit I had to break when I transitioned from typewriters to word processors years ago. The only time I see two spaces between sentences these days is in comments for Python code.
A space is a null character, a tab is a special character. Only a heathen would behave in such a way.
Yeah, you work at Google. Or you use any of the common languages / frameworks (Javascript, Rails, for example) who generally use 2 spaces. Or you just care about information density, since IDEs make code block folding completely fucking trivial, so there's very little need to create a strong visual offset with 4 spaces and waste screen space & file size by putting in unnecessary white space.
They don't dock our pay for using extra spaces, they dock our pay for doing stupid shit - something I'm sure you're quite familiar with, creimer.
Don't use any whitespace at all if you're unemployed.
Word at least used to automatically convert end of sentence to two spaces anyway - maybe they've changed. I still use two spaces at the end of a sentence because it's easier to parse.
The perfect number of spaces is 3.
Two is not enough to clearly see indents.
Four is just a waste of space.
I don't read your sig. Why are you reading mine?
I personally use spaces at work because the the tool my company uses to compile or include scripts reads tabs extremely terrible and there's not chance of that changing. By using spaces I can ensure that the script translates easily between Notepad++ and said tool. Makes it easier for both me, and more importantly, support.
At home, I use tabs :)
Done. Where's my money?
... and ask for the 20% salary increase?
I worked with a person who used three spaces. He's "not with us" anymore. :)
Tab'ers are more time efficient (and generally better human beings), so if the wages include hourly employees then of course they'll get paid less because they're not wasting time like those worthless space'rs.
Google learned it by watching professions.
"His name was James Damore."
Word at least used to automatically convert end of sentence to two spaces anyway - maybe they've changed.
Unless you're using a monospaced font, all fonts provide a little extra space between sentences without adding an extra space character.
Comment removed based on user account deletion
by the keystroke, apparently.
Yeah, you work at Google.
I heard about the two space indentation from a YouTube video that Google developers gave on Python. Or maybe Guido van Rossum joked about it in one of his videos on YouTube.
i assume that means you buried him behind the building?
...can we flood /. with? This is clearly the most inane and irrelevant piece I've ever seen. This Developer Study couldn't find any better measure to correlate with salary? How about "longevity of code after release," or "number of bugs found per annum," or "length of variable names?"
1.) Space-indent is almost universially used by old-school C coders and other compiled languages, because they use ancient CLI editors that don't tab by default and care squat about sourcefile size and bandwidth usage (as webdevs do), because they always compile. Those types are more rare but get more money for their work. Specialists.
2.) Space has come to dominate the indent-wars, which means a passionate tabber is more likely to be percieved as a stubborn non-team player and hence get lesser pay or be at low paying jobs where he/she is the sole programmer in a smaller shop that pays less.
3.) Because space dominates the official indent rule space, there are more automated tools enforcing space-indent which in turn means tabbers only are able to tab in smaller non-CI environments, which in turn means they are again more common in mixed shops.
4.) Tabbers are most commonly found in the web development community, where tab-indent means way less data travelling through the intertubes. Web coders earn less.
We suffer more in our imagination than in reality. - Seneca
This seem an age thing, right?
The type of text editor you use — Eclipse, Emacs, Nano, Notepad, vi, or some other IDE or stand-alone editor — can have a large influence on whether your code is intended with tabs or spaces, as most code editors have their own defaults for indentation. I would speculate that the type of IDE or editor a programmer uses has a higher correlation to salary than just tabs vs. spaces.
What's this supposed to mean? That the editor inside an app for making apps ought to store an app's logic as a syntax tree rather than as textual source code, with indentation calculated at runtime based on nesting in the tree?
"Developers Who Use Spaces Make More Money Than Those Who Use Tabs"
Small wonder. Just like in Microsoft Word, managers and executives have no clue on how to use tabs and uses spaces instead.
It doesn't even say whether female developers use tabs or spaces more often. This important contributing factor to the gender pay gap must be investigated and corrected!
Eloi are stupid, throw morlocks at them!
I'm pretty sure that the actual space (ASCII character 32) is rendered the same width regardless of its placement, even on proportional fonts. Individual characters stand alone in size and rendering, except when ligatures are involved. Some programs will insert a different kind of white space character - like an em or en space, or a second space after a period - but a font does not have anything different to offer when rendering a space between sentences. All you have to do is look at your own original comment to see that the space is the same size.
In Slashdot comments, my double-spacing is rendered in HTML as a single space because HTML only renders one space in a consecutive string of white space. However, I developed that habit out of visual preference - I started typing well after the typewriter era.
It's tabs. Here's why:
1.) Tabs are characters specifically meant for indentation - that is the only reason this character exists.
2.) They use up way less bandwidth. I once cut down an HTML document from my space fanatic buddy from 80kb to 36kb just by converting from spaces to tabs. When 50+% of your bandwidth is used up by whitespace, you're a shit coder. True thing. ... Use spaces on my product and I'll woop your ass.
3.) With tabs everyone can decide on his own how far the indent is. That's how it's meant to be. That's the whole point of the indent character called "tab".
That said, I've given up on trying to explain the above to space junkies - they really don't seem to get it.
Today I usually avoid this discussion and settle for whatever the official standard is for a given programming language and use buildtools that clean up the code form excess whitespace before deployment on the web. For JavaScript that's space-indent with two spaces - really shitty, but I guess they're trying to suck it up to the C-snob crowd, so who am I to think I could stop them. The advantage in going with whatever is the standard for a given PL is that you can use the standard linters and commit hooks as they come and easyly set up your CI and build environment in such a way that it enforces uniformity. If that means only commiting two-space indents, I'll bite the bullet. Especially if I'm the lead and/or responsible for the dev-pipeline.
We suffer more in our imagination than in reality. - Seneca
Let's use 4 bytes for each line instead of one byte. Makes perfect sense!
Interesting cross correlation for two things that should not have cause and effect.
Two theories:
Perhaps there is something about what the higher paid folks are working on the tends to force spaces.
Perhaps culture, language or IDE.
Tabs save keystrokes but add other problems.
Maybe the folks that feel that this is a bad tradeoff are making better decisions because they have more experience and have been burned by tabs.
All you have to do is look at your own original comment to see that the space is the same size.
Slashdot isn't a word processor that uses proportional fonts. Of course, the space is the same.
My goodness tepples, you never told us you speak App. Now at last we have a way to reveal the meaning behind his gibberish.
Another non-scientific poll/survey on the internet that means nothing, but is posted to cause a comment flame war. SPACES! TABS! GREAT TASTE! LESS FILLING!
Popisms.com - Connecting pop culture
Their salary should be zero.
...you'll make more money, right? That's how these things work right?
My comment is displaying in Arial - a proportional font. The font operates the same whether it's a word processor or not. If a word processor is displaying it differently, it's also not just a space character being displayed and the file won't contain just a space character either.
Or GitHub is too picky with the tab/spaces differences? I tend to use tabs (not something I really care about, but... I wish the worst to the Hooli-loving space heretics! LOL), but also in languages not caring about spaces/tabs (every language other than Python?) and IDEs which theoretically should take care of these issues automatically.
For example, when writing C# in Visual Studio, I don't even need to use tab/spaces (write a line of code, with 1-space separations between words, press enter and VS automatically sets the left indentation of the next line). If I want to change the default indentation, I use tabs. Same thing with other IDEs I use like NetBeans, Eclipse or Code::Blocks; I also use Notepad++ quite a lot and it seems to perform quite well on this front (it might not even provoke the problem which I am referring right now). But here comes the tricky part: when I upload a code created with one of these IDEs to GitHub, I usually get some files with random lines being wrongly indented, even though they look fine in the IDE. I think that this is provoked by the times when I paste in the given IDE code which I have written with a different program.
This isn't precisely a big deal, but kind of curious. Why is GitHub not getting what IDEs/editors get and even what the naked eye gets (if you edit one of these files in GitHub directly, let it looking fine and save it, the wrong-indentation might still be there; you have to remove all the lines not fully synchronised with the expected tabs/spaces)? Or even more important: why caring so much about spaces/tabs in programming languages pretty much ignoring that aspect and compiling fine regardless of this issue?
Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
Or I'm sure there are studies to show the correlation between ass kissing and promotions are ubiquitous across all fields. A corollary from this would be: It's not how well you do your job that matters, it's how well you kiss ass. Ego-stroking will get you everywhere. And that we also see in Silicon Valley as well.
We'll make great pets
Three spaces? That's ... odd.
2 can be hard for some people to eye the alignment accurately, and with 4 you run out of line length too often, unless you extend your program line arbitrarily like a moron.
Also it is harder for the tab mafia to convert your 3-spaced code into tab graffiti.
3 spaces - the choice of champions.
Where are we going and why are we in a handbasket?
I first learned 2s space because it was the standard for HyperTalk, the scripting language of Apple's HyperCard, and enforced by HyperCard's script editor. HyperTalk predated the World Wide Web, let along Google.
And many get paid less than plumbers. Really that is a pretty low salary, you would think they were H1B visa holders.
More explanation than one may want...
https://en.wikipedia.org/wiki/...
A related topic is kerning, which means that characters are *not* rendered the same in all cases. "kerning is the process of adjusting the spacing between characters in a proportional font, usually to achieve a visually pleasing result. Kerning adjusts the space between individual letter forms, while tracking (letter-spacing) adjusts spacing uniformly over a range of characters.[1] In a well-kerned font, the two-dimensional blank spaces between each pair of characters all have a visually similar area."
"The CSS property text-rendering: optimizeLegibility; enables kerning in Firefox, Chrome, Safari,[11] Opera, and the Android Browser.[12] There is also a proposed CSS3 property font-kerning,[13] but it is only supported in Firefox (prefixed with -moz-), Chrome and Opera (prefixed with -webkit- in both) and in Internet Explorer starting at version 10.[14] The CSS3 draft suggests that kerning should always be enabled for OpenType fonts."
Nice guys always get paid less than rude assholes.
Forcing your indenting preferences on others (by using spaces) is a hallmark of a rude asshole.
If it translates to X spaces or an actual /t, that's really not my problem because any whitespace-as-syntax language is fucking retarded and so are the people that use it.
Fuck Python.
And F#.
I understand that lots of editors automagically convert the TAB key into four spaces. That's cute and all, but do any editors have the ability to "remember" that you hit TAB there so if you go back to delete the space, it'll delete all 4 space chars?
I know from experience that none of the standard cheapo editors do, nor does, say, MATLAB's editor.
There, then, is one excellent reason to use actual real TAB characters: the ability to delete them when you want to.
https://app.box.com/WitthoftResume Code: https://github.com/cellocgw
And if a Google developer mentions it, then that automatically means that ONLY Googlers do it, and it was invented at Google?
Significant risk you will become a kernel hacker. Beware.
That's why I get the big money!
-- Tigger warning: This post may contain tiggers! --
And if a Google developer mentions it, then that automatically means that ONLY Googlers do it, and it was invented at Google?
That only works with Apple.
This is fake news. If you can't see indents with 2 spaces, another space isn't the solution to your problem. 3 is right out.
"Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
Makefiles use both. The Make standard requires that commands in recipes be indented with one tab. Everything indented that's not a command in a recipe, such as long lists of prerequisites for a target using a backslash for line continuation, uses spaces to keep them visually distinct from the recipe.
I want to know if there is a salary difference between people who keep the bracket on the same line of the IF like so:
if () {
}
Or put it on the next line, like this:
if ()
{
}
Word verification: butyrate
Comment removed based on user account deletion
Tabbers are most commonly found in the web development community, where tab-indent means way less data travelling through the intertubes.
Why? A JavaScript interpreter uses braces rather than leading spaces to identify blocks. Line-initial space and most other whitespace gets removed anyway when the build process minifies JavaScript source into the form sent over the wire.
Idiots that program on huge virtual screens and don't think that anyone in this day anyone wouldn't be
writing lines of code that make a perl one line look simple.
In inherited project I have code files that have single lines of code that are OVER 500 characters.
There is NO reason in hell to write a single line of code like that.
LUDDITES don't use any equipment that has tabs or spaces ... or APPS.
It little behooves the best of us to comment on the rest of us.
More experienced engineers make more money, and also have more knowledge of the tools they use and have their editor convert tabs to spaces.
I'm using backspaces, but earn nothing...
So then what was the point of your whole comment? Were you just commenting to spam your blog link around?
Correlation != Causation
Correlation Causation
Correlation NE Causation
Correlation NOT EQUAL Causation
Perhaps, the language and/or common IDE tools for a given language makes a determination as to whether tabs or spaces are used. In particular, something as simple as the default font used could make a difference in visual appeal. As such, what this likely determined is that a higher paying programming language's common IDE is likely more favorable visually toward spaces.
All of that says that most digital editors currently don't add a second space between sentences.
I know all about kerning - but that's between letters within the word. Nothing to do with spacing sentences.
Developers who make more money prefer to use spaces over tabs.
with 4 you run out of line length too often, unless you extend your program line arbitrarily like a moron.
Or you need to refactor your code better. Linux has no problems with 8-space tabs.
Spaces are always one character, tabs can be interpreted differently on different platforms/editors, etc. I use spaces, so I know exactly what the code will look like in any monospaced font. M-x untabify and C-M-\ fix non-compliant code nicely in emacs. Interesting correlation with salary, but I don't think there's any specific causation.
App = advertising laden crapware
Application = software used to accomplish a task.
I'd also ask for more money if my boss insisted on spaces. Like I have nothing better to do all day long than correcting code that starts in columns that are not multiples of 4...
that happens to use spaces.
-- moo
I worked with a person who used three spaces. He's "not with us" anymore. :)
I use 3 spaces for personal stuff. 2 is just not enough visual cue for me. But I don't inflict that on others.
Socialism: a lie told by totalitarians and believed by fools.
I know for a fact the two very big ones use WebKit's style guide as a basis for most of their work, and that it asks you to use spaces.
"Two" big ones? The large employers are the "Big 5": Amazon, Apple, Facebook, Google, Microsoft.
What's a "WebKit"?
Socialism: a lie told by totalitarians and believed by fools.
Five!
Three, sir.
I also can't work with 2 spaces - just not enough visual cue.
Socialism: a lie told by totalitarians and believed by fools.
Stop trolling us with irreverent and irrelevant click bait, Slashdot. The innuendo of Slashdot editors is that Python programmers are either amateurs at their craft or further down on the food chain than programmers who use languages that accept spaces.
On the other hand, the innuendo could be that programmers who code with an IDE are lower down on the food chain than those programmers who code with a space based editor.
Irreverent and irrelevant.
Run some important surveys, Slashdot. No more "fake" surveys, please.
With averages that low, you programmers who completed salary survey should spend more time coding or marketing your skills.
Top managers who use spaces because they never understood tabs (because tab's are something that only typists use), they make more money than anyone else despite being quite unable to format a simple document.
Why would anyone use 4 spaces?
If you're using spaces, you use 2. If you want more whitespace than 2 spaces, you're a tabs man, not a spaces man.
...now you're getting creimer. He thinks he'll retire a millionaire on the basis of a few atrociously horrible ebooks he's flogging through his activities here.
It wouldn't be so bad except for his repulsive personality and repugnant writing.
Probably left to get a better job where they appreciate the vast superiority of 3 spaces.
I don't read your sig. Why are you reading mine?
Try using more spaces.
I don't read your sig. Why are you reading mine?
Turns out that you come to a conclusion first, then examine data looking for any statistical anomalies that might support your conclusion, then present those anomalies as proof that your conclusion is correct.
Stack overflow is not really a bastion of elite developers
It's demographic is a reflection of its purpose.
More talented coders might write elaborate routines with more levels of indentation. With tabs, the inner level lines would wrap around more and make it harder to read.
What does this survey have to do with the price of eggs in Liverpool? David Silver is not going to be any bit smarter if he makes £200 thousand than he is if he makes £500 thousand. He's still David Silver, one of the best. The point is that earning power isn't a sign of genius.
Well thank you for settling that.
I don't believe in karma, I just call it like I see it.
Ugh, where I work the standard is hard tabs set to 8. I hate indenting so deeply, it's hard to read... but it is apparently the linux kernel standard, so that's what we do. I challenged it, but was told if you have to indent more than a couple of levels your function is too complex. That may be a reasonable answer for C and kernel code, but not always reasonable for user code or other languages.
I set my editor for 4 spaces, but there is always a line here or there that has spaces instead of tabs and so it throws everything out of whack. It could be a cut/paste artifact, or a "smart" editor glitch, or who knows.But since everyone is using a "smart" editor nobody is paying attention, and the invisible mistake goes unnoticed until I open the file. But since I am using nonstandard indent, nobody really cares.
They also use tabs to align inline comments, which are thrown off if you change the spacing. My standard is tabs to indent, spaces to align, and after some effort found a vim mod that does this. But it was took effort to find and install, and few other editors support this concept, which means nobody else does it.
I finally resorted to a special rule in vim to set ts=8 in directories that I don't own, but default to ts=4 everywhere else. And I double check that my code looks good with ts=8 before I check in, otherwise if there is a visible indent issue someone will notice and re-tab my file.
I slapped him so hard, his tabs expanded ...
The correlation here is backwards.
Programmers that make more money tend to use spaces.
Why? Because programmers that make more money probably work for bigger companies. Bigger companies have coding standards. I've yet to meet someone that works for an organisation of any size that has a coding standard that enforces tabs over spaces.
Now, why do companies use spaces over tabs? I'm not sure about that.
but I know I stand for everything they DONT stand for. Also, they called us idiots.
My theory is that space is mandated by corporate style guides. When I'm banging stuff out for myself, I use tabs but I make no money on it. If enough money is on the line, I'm not going to argue about it. I'll just tap, tap, tap, tap the keyboard instead of tap the keyboard, or hopefully find a keyboard shortcut or hack that lets me delete 4 spaces when back-spacing at the beginning of a line. I'd be happy to switch to spaces and get along with everything in the repository if the editor were advanced enough to make the conversion fully transparent, ie, a non-issue. Perhaps the higher paid developers are also able to afford better tools.
Tabs are for indentation. Everyone can choose how to display them, either as 2, 4, 8 (?!) spaces wide, by setting up their editor appropriately, and yet they all commit the same thing, one tab for each level, so there is no whitespace modification ever. Also, even people who use spaces in practice press the tab button. And the tab button produces spaces. Not OCD friendly.
At the same time, ALIGNING things requires spaces. You align things (e.g. operators) that are at the same indent level (denoted with tabs) and everyone sees them the same, just at a different distance from the start of the line depending on their tab setting.
At my previous job I had written the style manual, so we went with that. In my current work, it is all spaces and I don't really mind, as at least we use the same width that I'd use to render tabs, so everything looks nice. HOWEVER, it is not very rare for people to re-install, update etc their editor, continue hitting tab without realizing they had lost the spaces configuration, and their first commit changes all the whitespace...
Violence is the last refuge of the incompetent. Polar Scope Align for iOS
Will my employeer give me a raise for switching from tabs to spaces.
True, but it is also rational.
"So long and thanks for all the fish."
Maybe they put the difference on their tab. ;)
If you use spaces to indent your source code will look the same for everyone and will look the way you intended. Spaces always work and always work in the same way. If you don't like counting, use an editor that uses the tab key to insert the proper number of spaces for the indentation. But counting always works if you can't figure that out.
If you use tabs to indent you have to rely on people correctly setting the tab width to match what you are using. And if they don't know how to do that and it is set up wrong, their impression of your code is that you are a twit and don't know how to consistently format your code. This is especially a problem with PHB that may be have little technical knowledge and decide to have a look at something. First impression is that your code looks unorganized.
People shouldn't be reformatting your code to match their expectation of indentation unless they are taking over the project. Use the same indentation (and tabs set to the correct tabwidth if that is what the original author used.)
Stack Overflow's "research" failed to account for the fact that only SOME of the respondents indicated what their income was, and it's self-reported, which means the info was garbage in the first place. You've heard of "Garbage-IN, Garbage-OUT," right?!?
At most, if, and I do mean IF, the reporting IS accurate, all you can really take away from it is that people who use spaces in their code instead of tabs are more likely to disclose their income.
By the way, I make over $75,000 a DAY from home writing code using neither spaces NOR tabs. Whitespace is for PUSSIES.
See how easy it is to lie? I don't make that much money even in a YEAR, and I don't generally CODE since the only programming language I learned even close to the level where I could do anything in it was BASIC!!! (I also learned a little 8086 Assembler and C, but not enough to do anything useful with either.)
The point of taking my valuable time to write this is because this kind of article on a day that isn't April First, begs a question: WHO THE FUCK IS EDITING AND DECIDING WHAT "STORIES" GET POSTED TO FUCKING SLASHDOT?!? Monkeys? Retards? Or just people getting paid to post BULLSHIT?
The two big ones of those fave though, are Apple and Google these days.
A WebKit... well... if you don't know what that is, you may need to learn a bit more about the tech industry.
Yes. Tabs are aligned on 8 space boundaries. Hence the scenario you describe is perfectly normal. I have used this exact system for more than 30 years. You are the anomaly if you have not used this or somehow think it is unusual.
Kerning involves adjusting the space between a pair of characters individually for each pair. I fail to see how it couldn't be applied to widen the gap for a period+space pair ..?
That being said, if it is used in the commonly used fonts, I've never noticed.
Tabs are 8 spaces. Using anything else messes up all the alignment. You can't just change tabs to 4 spaces (say) and expect us to tolerate that.
I take up a lot of space and make ridiculous sums of money. If was down the TAB I may make a lot of money, but mostly be in debt all my life.
Moron like a fox...300 characters to the right is the perfect place to hide a logic bomb. Get that sucked buried deep in the rev history, under someone else's name.
If you're not using a server filter to minify http responses (which removes nonsemantic whitespace) you are a shit coder. Knuth is right about premature optimisation: the only concern should be readability of source code because machines are better at optimisation than we are.
And if you write HTML by hand you are a shit coder. And being so concerned with micro optimations is for shit coders. Seriously, is the a post from 1999?
Does everyone at Google rape goats, or just you?
There's that moment in TV Shows where they get the tech wrong and all the believability just disappears.
24 used to walk the fine line with this, but seemed to use basic gobbledegook interspersed with tech words so there wasn't a meaning...
Mr Robot shot it completely when its executive walked up to the main star and complimented him on the use of Gnome as a desktop. Gnome??? Versus what? KDE? If it was cinnamon, mate or Xfce, yeah, but "oh look you use one of the most popular desktops on linux"!
Silicon Valleys tech has always been a bit wobbly, though can be forgiven for making it funny. The tabs versus spaces thing just shot it to bits.
You use an editor which converts your tabs to spaces, auto indents and allows mass selection and auto formatting according to languages. Whoever fed the writers that needs to enter the 90s. It's not even a putty vs mobaxterm (which is no battle at all, mobaxterm).
What we have here is a bunch of average coders who have nothing better to do than take surveys, and we find that among them there is a correlation between the use of spaces and a *slight* boost in salary.
What about the rock stars? What do they do? And what about the people who don’t consider themselves “programmers” who can code rings around those survey-takers? I know electrical engineers whose code looks like shit to me but beats the hell out of most of the stuff I see on github. Some use tabs, some use spaces. Who cares! These people make a minimum of $150K/year, putting them outside of the range of this sample.
In my history of doing software engineering and digital circuit design, I have used tabs, spaces, and combos. After a while, I gravitated to using spaces in order to ensure that the code formatting would not change for different people. But what I actually use varies with the language.
In C and C++, I use four spaces to indent. In Ruby, my two editors (vim and TextMate) do not have the same settings, so some code is indented 2, some 4. For Python, I use Jupyter, which I *think* defaults to 4 spaces, but I’m not totally sure, but I don’t care because I hate Python and only use it for sympy. For Java, I mostly use Netbeans, which I *think* uses 4 spaces. My Verilog code looks like a C programmer wrote it, because I can’t stand to put “begin" on separate lines, so I end up with things like “end else begin”, and I use four spaces to indent instead of the usual 2; I’m a maveric. I can read VHDL just fine, but I avoid writing it as much as I can. Assembly generally isn’t structured, so its indenting is really unimportant. I haven’t programmed Fortran since the days when you had to start in column 7. My Javascript code is indented like my C code; same with PHP. I can code in other languages too most of them require very little reading to get competent with the basic syntax, but the libraries can take a while to really master, so instead of investing time into “learning” them, I just google what I need as I go along.
My favorite code-oriented job, however, is “expert witness.” There, I get to pick apart other people’s code and show how it does and does not match patent claims. I don’t have to write a single line of code, and I make $250/hour or more. The free trips to Washington, DC are nice too. Of course, this is no cake walk either. It takes a lot of concentration and energy to interpret patents and make sense of mazes of horribly structured code, which is why it pays that well. I keep getting called because I’m an expert in both graphics and digital circuit design, so the lawfirms always get a bargain.
All this post proves is that the posts author doesn't understand statistics.
I have vim setup w/ expandtab, so I press the Tab key, but it inserts spaces.
Not sure why you'd think they're the biggest - they're all quite large (well, Facebook is the smallest). It's hard to get a count of total engineers in these companies, but Microsoft, may still be the biggest employer of devs - over 100K for sure. Amazon will be there soon if they aren't already - at the rate they're growing they'll be the largest employer of devs by far in about 2 years (they're current building 1 skyscraper a year in Seattle).
Apple is the odd man out for not being "the cloud" as the other 4 are. The other 4 have fairly heavy interchange of devs between them now that the illegal recruiting agreements are gone.
Judging by UIDs I've been doing this a bit longer then you kids on my lawn. But I write real code, not some silly "web" fad stuff that will be replaced by APPS (or so Slashdot informs me).
Socialism: a lie told by totalitarians and believed by fools.
OK, people who use space make more money than those who use tabs.
What about we talk about a significant reason to choose one over the other?
I've been using 2 spaces for indentation (and 1 space for continuations) since about 1985. This preserves structure while fitting more information on a line. For the same reason I put the '{' at the end of the line with the procedure definition or 'if' statement etc - more lines per page. That way you can keep to the rule of 'no procedure larger than a screenful' while actually getting some work done :-)
Developers who use spaces instead of tabs are more likely to accidentally add zeroes to survey questions about finances.
I use my Will to indent, saving me 7.4 minutes of lifetime from not having to hit keys.
Of course space-using devs earn more money. Because Space, and as we all know, Space is Cool!
You know, Code In Spaaaaaaaccccccceeee! Cool.
Why not use both @ the same time?
I press [Tab] to indent for convenience. I configure editors to insert two spaces for each press of the [Tab] key and convert all existing TABs to spaces upon saving. I prefer spaces and like the indention increment set to two.
.
Landfill Mining Co.
Managing the (Un)natural Resources of Tomorrow
Most professional coders will use whatever conventions are already in use in the code they are working on. Programmers who re-indent and/or re-tab source code in a professional environment tend to get reprimanded for wasting time and messing up the merges.
So, this is really more of a correlation with what types of projects pay better than whether spaces or tabs are used.
An engineer who ran for Congress. http://herbrobinson.us
I use neither. When I hit save, it auto-reformats. I'm not sure really which it becomes.
Checking...
Tabs. Oh well, it's not me writing them.
Science & open-source build trust from peer review. Learn systems you can trust.
Wish I did not waste my time reading this silliness!
I seriously doubt any correlation between salary and whether one uses spaces or tabs to indent!
For what it is worth, I have my editor pad with spaces when I hit tab.
That way, I can indent with spaces, yet use the tab key.
Can I now get a raise in salary?!
Self-importance and self-indulgence is the root of ALL evil.