
It reared its ugly head again today - while talking online the great TABs Vs Spaces for the indentation of code debate leapt out and revealed a great chasm between 2 groups of erstwhile friends. While I am mostly ambivalent regarding many of the source code formatting options available to the discerning developer today (cuddled Vs uncuddled else clauses, inline or next-line opening braces, etc.) I just cannot fathom any single reason as to why anyone in their right mind could possibly argue logically that spaces should be used for indenting code... ever... for any purpose whatsoever...
I should have donned my flameproof jacket back there, but hey. :-)
Key to my argument for using tabs rather than spaces, is the fact that it's intuitive to use the TAB key to indent code - so a single press of the TAB key = a single indent. While there is a clarification of meaning required as to what the TAB key actually does Vs what the user sees (See http://www.jwz.org/doc/tabs-vs-spaces.html) it surely makes sense that the tab character gets inserted in the file. This means that the presentation / formatting of the code is slightly seperate from the content of the source code. I, personally, prefer a tabwidth of 3 spaces. It works well for me but I would not even suggest to impose it on anyone else. Others prefer 4 space, some prefer 2, yet others like a different quantity - which leads me to the two key points as to why tabs are clearly better than spaces for indentation of source code:
