Originally published at: http://boingboing.net/2017/06/16/digging-gold-with-spacebars.html
…
Some PMO/Lead changing the standard to Tab indents because they do not understand the underlying reasons in
5
4
3
2
…
Unless you’re compiling on microsystems disk space and memory are no longer issues, so unless the language requires it (Makefile) there’s no use for hard tabs and the problems they cause any more. And any competent developer knows how to set their code editor to act like it’s using tabs but actually use spaces. So that probably correlates with being more competent in other areas as well and a higher salary.
Now what surprises me are that the people who use both are making the same as the people who just use tabs, because people who mix spaces/tabs in the same file are the f@#$ing worst by far - hopefully most of those people who answered are just using one or the other in a given project.
For my teams, announcing this topic would be like throwing a raw brisket betwixt two rabid wolverines.
No wonder Pied Piper keeps struggling…
This is such a bizarre non-issue. I’m always reluctant to conclude that other people are stupid, but:
- Any decent programmer’s editor should hide the mechanism of indenting from you. You hit Enter, it auto-indents the next line. If you want to indent further, you hit Tab or some other keystroke (Cmd-] on most Mac editors, for example.) That scene from “Silicon Valley” where she’s hitting Space-Space-Space-Space is funny, but anyone doing that in real life is an idiot.
- The amount of space saved by tabs in a source file is miniscule. And it goes away completely when the file is compressed (as it is in any source-control archive.)
- There is a very real lack of consensus in how wide a f***ing Tab character is, and for historical reasons it will never be reconciled. Unix says 8 characters, Windows (and old Mac tradition) says 4. And tabs in HTML, even inside a preformatted code block, just don’t work. The result is that if you use tabs in text files, it will often mess up the appearance of the file.
Looking at the above, I really don’t understand why this is even an issue. Unless most developers are using lame editors (like Notepad?) that actually force them to type the individual tabs or spaces, in which case the real issue is why people use sucky editors.
Well correlation pretty much implies causation, right? I wonder what the exact mechanism is here?
I was wondering whether it was age. I would speculate that spaces were more commonly taught 20-30 years ago so that older, more experienced programmers were more likely to use them.
use tabs, but don’t save as spaces, 1 tab = 4 characters for me currently (recently switched from 2 because I’ve got a new 27" screen and my code was looking a bit cramped), if you keep it as tabs each user can change their editor to suit their tab-width preference without having to reformat the document.
Other examples: sendmail.cf, syslog.conf in HP-UX and early BSDs. I have always hated programs that made distinctions between non-printing characters!
I generally don’t bother learning fancy programmer editors that go in and out of fashion in less time than it takes to master them, instead I use the editors that are most commonly found preinstalled in all environments. So mostly vi and notepad these days. I’ve never had any problem with quality or quantity of code output using plain old raw text editors.
But then again I’ve had to code in environments with literally no editor at all! I’m older than dirt, I can remember using a SEL drum memory machine for data acquisition that was programmed with front panel toggle switches.
I use spaces, unless somebody’s paying me not to.
Here’s the problem with pseudo-tabs with spaces. It assumes that spaces vs tabs are always equivalent. But they aren’t in data! Scientific data is very often in tab-delimited files, because spaces can be legal components of fields. Sure, I can configure my editor to insert spaces rather than tabs when the tab key is hit and for programming it makes no difference. But if I try to modify a data file (to give more meaningful sample names, for example), that completely screws things up, as hitting tab doesn’t put in a tab.
The most l33t h@xx0rz use neither tabs nor spaces. Line numbers FTW!
10 PRINT "I AM AWESOME! ";
20 GOTO 10
30 REM APPLESOFT BASIC RULEZ
I AM AWESOME! I AM AWESOME! I AM AWESOM
E! I AM AWESOME! I AM AWESOME! I AM AWE
SOME! I AM AWESOME! I AM AWESOME! I AM
AWESOME! I AM AWESOME! I AM AWESOME! I
AM AWESOME! I AM AWESOME! I AM AWESOME!
The most widely used editor on Windows says it’s 8 spaces as of Windows 10.
And ‘ls’ in powershell gives you a dir listing now, too.
Here’s one for you:
Salary comparison of people who modify data files by hand vs. modify data files using code or other automation.
“Mixed spaces and tabs” is a bit ambiguous, in the spawn of Satan category I put random one line indented with spaces and the next with tabs based on what developer wrote which line. A close second is “4 spaces for the first level of indent, only an 8 space hard tab for the second level (a line indented exactly 2 levels starts with only the tab, not 4 spaces then the tab), and then a tab and 4 spaces for 3 levels, etc.” Yes, I have seen an entire project organized that way.
A less evil option for mixed in a file is tabs for nesting indentation and spaces for alignment.
In my about 20 years of experience it has seemed to be the other way around. Older style guides and source files seemed to be more hard tabs, often 4 or 8 character indents. Newer style guides, and sometimes even language/framework built in tools mandate spaces, often only 2 spaces per indent, some times 4.
Point taken, but in practice sometimes you really do need to edit files manually because the transformation isn’t just a algorithmic processing of the data.
What sort of maniac would tab-delimit their data files… and then edit them manually… that’s asking for a disaster if you can’t actually see whether two items are or are not actually just one item.
No way to differentiate between
foo mah piku
and
foo mah piku
o_o
I’ve configured VIM to insert spaces when I hit “tab”, so I’m not sure which category I fall into.
Oh. I was hoping maybe the space characters were causing quantum interference with the IBM 5150 over in HR.