This argument came up again for me recently at the company I work for (Snowblind Studios). I had been told to stop inserting spaces where tab characters belonged, and an all-to-common scene ensued wherein I espoused the tabs-are-evil mantra but had little memory of why that mantra was with me.
So I did a bit of research to put the matter to bed once and for all. Or, so I thought. Hah! What a joke. This is a religious issue if ever there was one. Want to see just how religious this argument is? Just check this out:
I mean, just look at all those posts? That's a flame-war if ever there was one!
A good clinical overview of this tabs vs. spaces can be found at this URL:
An excerpt from that article:
- Tabs versus Spaces: An Eternal Holy War by Jamie Zawinski (http://www.jwz.org/doc/tabs-vs-spaces.html)
- Why I prefer no tabs in source code by Adam Spiers: (http://adamspiers.org/computing/why_no_tabs.html)
- Why I love having tabs in source code: (http://www.derkarl.org/why_to_tabs.html)
Tabs in programming
In computer programming, the use of tabs for code formatting and indentation is an ongoing debate. Programmers are generally divided into two camps - those who use hard tabs in their code, and those who configure their editors to insert actual space characters when they press the tab key. When tabs are replaced to spaces in this way they are referred to as soft tabs.There are many arguments for and against using hard tabs in code. What can be said without doubt is that one early benefit of tabs, i.e. compression (see above), is now less relevant as storage is so cheap, and sophisticated compression algorithms can provide much greater benefits.
External links
Other argument summaries:
Pro Tabs:
- http://www.movement.uklinux.net/docs/whytabs/
- http://www.derkarl.org/why_to_tabs.html
- http://www.wiggy.net/rants/tabsvsspaces.xhtml
- http://www.adamspiers.org/computing/why_no_tabs.html
- http://www.jwz.org/doc/tabs-vs-spaces.html
- http://www.jspwiki.org/Wiki.jsp?page=WhyTabsAreEvil
And yet more from the why_no_tabs page:
- Possibly the best pro-tabs page I've seen so far. I agree with most of what he says, except the bit about diffs looking fine. He also forgot to consider quoting code in e-mail.
- Indentation/Tabs/Space Policy in a C++ coding standard
- Style guide for Python code
- http://www.rudbek.com/Code_gui.htm#Guideline_No_Hard_Tabs
- http://babbage.cs.qc.edu/courses/cs101/Coding_Guidelines.html
- FreeBSD style guide
- How To Write Unmaintainable Code
- http://xarg.net/writing/tabs
- Coding standards for the Jakarta Project
Someone who didn't give his name sent me a whole bunch of related links. I'm relieved to see that these pages mostly agree with me :-)
No comments:
Post a Comment