Guitar tabs vs Space aliens
Jan 29, 2014
4 minute read

Dear Amos,

After […] reading extensively on the matter online, I have come to the conclusion that one may indent using tabs or spaces interchangeably, as long as they stay consistent within a given project. That is, before the article ended abruptly on a “but only idiots would even try to argue against using spaces”.

So, I get it - that’s humor. But I still have to come across one convincing argument in favor of using spaces, whereas the argument for using tabs appears, to me, rather obvious.

Ah, so we return to the old classics a-la Windows vs Linux, Gnome vs KDE, or even Mutt vs Pine…

I am personally a proponent of spaces, but then again I am also for brace-on-the-same-line, spaces-before-parenthesis-for-control-structures-but-not-function-calls, spaces-around-all-operators-except-maybe-unary-ones, and other things that are equally difficult to defend and have garnered extensive debates for generations of programmers.

The problem with such a debate is that I will not be able to convince you, any of you - if I come up with an argument, you won’t say “ah, this is a valid argument, but I still won’t change my mind” - you will say: “this argument is invalid”, and so, it would be a perfectly engineered waste of time to write any further words about the subject.

Then again… since I have a fresh cup of tea and not much else to do before my mind is completely awake again for the third time today, I will once again have to resolve to sacrifice my otherwise precious time (haha) to the altar of arguments without faith, god or descent.

Here’s a list of the main pro-tab arguments:

But it saves bytes! - sure, and while we’re at it, let’s trim all those unnecessary spaces - and newlines, I’m pretty sure that then, non-compressed files will indeed load faster on your 56K internet connection.

It’s configurable in My Super IDE (Enterprise Edition - Trial version, -17 days remaining) - right, and that is also true of any respectable text and code editor - everything else though, you’re pretty much shit out of luck.

From the very moment that you have a character which width depends on user configuration, it’s doom from day one. So, yes, you can avoid tools with non-configurable-tab-widths (including obscure stuff like, oh, cat, and diff), and yes, you can spend half your time configuring all the rest in a consistent way, and yes, you can spend the quarter of the remaining time filing feature requests for the various products and services you use so that they will support your world-changing setting, and even in some extreme cases, you can be a rebel and declare that both tabs and spaces are garbage and come up with another fantastic idea.

It’s just the right thing to do, conceptually! - some people disagree with that, too. It doesn’t matter whether you use tabs, or spaces, you’re still formatting code so that a human may read it more easily. The compiler doesn’t care, and for most languages, you could remove all leading whitespace and have a command-line utility put it back, except without your sloppiness.

And it is that last argument that brings me to pro-space arguments. It is first and foremost a questin of pragmatism: using spaces, or tabs, or elastic tabs, or globulox vergaflixes, doesn’t change a thing - in any case, we have yet to reach the singularity in which we do not edit a representation of code, but the idea behind that code itself.

To flatly flaunt the fleeting and conflating subfleet of flimsy reflections people remember about Plato - one could say that we are still stuck, trying to give birth to an external world by painting on the walls of the cave with the blood of our unborn young, dead in concept the very moment we started a career in Computer Things.

Coming down to earth again, the reasoning of a human who (consciously) chooses spaces over tabs is the following:

I acknowledge my impotence faced with the gigantic task of bending the whole wide world to my every whim, and would rather choose my battles to strike in a more efficient manner, on reduced set of targets.

I am willing to waste between 2 and 4 spaces by indentation level for the enormous benefit of seeing my code formatted consistently everywhere I go.

And last, but certainly not least, I solemnly swear on Eric S. Raymond’s head that I shall never, ever, ever enter into an argument about this with anybody. Ever.

I have betrayed my serment on that very last point :(

My life is a failure.

Tragically yours,
- Amos Wenger