John Chamberlain
Developer Diary
 Developer Diary – You Heard It Here First – Thursday, 18 January 2018
Tabs Versus Spaces
I gave up on Emacs fifteen years ago and there is a story behind that. Originally, when I was a student, I used Emacs exclusively when doing programming assignments on Unix systems. When I started programming professionally, it was very rare for me to use a Unix system, so Emacs faded into the background. In recent years, I have increasingly used Linux systems because I do a lot of algorithmic and server-side programming. When this trend began, I first tried to use Emacs, but there was a problem: Emacs indents using spaces, not tabs. I put up with this for a little while, but eventually got annoyed and I made an effort to configure Emacs to use tabs. This is actually extremely complicated to do, believe it or not. I ended up spending an entire afternoon writing a 30-line program in Lisp to try to get Emacs to use tabs. Ultimately, I failed and came to the conclusion that there is no combination of settings that can force Emacs to use tabs and behave in a normal and consistent way. This is not an accident. This is because the creator of Emacs, Richard Stallman, has deliberately borked his editor to prevent anyone from doing what I tried to do: make Emacs use tabs. Superficially, Emacs gives the appearance of supporting tabs because there are several settings with innocent names like indent-tabs-mode that give the impresssion that you can indent using tabs, but, in fact, the program is carefully and subtlely crafted to make sure anyone attempting to do this has a frustrating experience.

Now, why would Stallman do such a sinister and evil thing? There begins the tale...

I actually know exactly why he did this, because I grew up at the tail end of his generation. In the spring of 1980, I was 14 years old and had my first contact with a computer. I entered the Wellesley Junior High School in 8th grade and they had a new computer room and in that room were a bank of teletypes, of which the school was immensely proud. These teletypes were provided by a local company, Honeywell, and connected to a mainframe at their premises. This was probably a Series 6000 which looked like this in its heyday: Honeywell 6000 Series

Of course, I never saw the computer, I just worked on the teletype which connected to it, which looked similar to this:
Teletype
The gizmo at the left of the machine (on the right in my case) is a paper tape reader. You could not store programs on the mainframe because storage was too precious. Instead you would print your program to paper tape at the end of the day to save it, and at the beginning of the day, you would feed your tape into the reader to load it. To store the tape you would roll it up like a hockey puck and tape it fast with scotch tape. The Series 6000 computers supported three languages: Fortran, BASIC and Abacus (a calculator emulator). I wrote exclusively in BASIC.

Using a teletype was difficult because it took a great deal of force to punch the keys. A teletype is nothing like a typewriter. It is designed to send telegrams, not write documents. For this reason its keyboard layout is different than that of a typewriter:
If you examine this layout, you will see, among other things, that it has no Tab key. Telegrams have no indentation, and no formatting at all, for that matter. Therefore, teletypes had no need for a Tab key. For the programmer this meant that the only way to indent code was to use the space bar. Luckily for us, the space bar on a teletype had a special mechanism. It was spring loaded and motorized, so that even a light tap on the space bar would produce a space. This was different than the rest of the keys which required bone-crushing force to depress. Even with the ease of tapping the space bar, it was still quite a nuisance to type spaces to make indents; one tap too many and you had to use RUBOUT to erase it (no Backspace key either). It was a different world, a world where tabs did not exist. I only lived in this world for six months, but Richard Stallman, who started programming in 1970, lived in this world for over a decade. For ten long years, Stallman indented all his code using nothing but spaces.

When PCs appeared around 1980, they used a new keyboard paradigm. Instead of using teletypes to enter data, they used a completely new device, a "keyboard" that was modeled after typewriters. These devices had Tab keys and Backspace keys. It was a revelation. No more thick calluses on our fingertips, we could type away electronically. The new keyboards were even easier to use than typewriters because they required less finger force. Everyone in my generation quickly adapted to the new technology. At my school, they junked the Honeywell teletypes and brought in a raft of brand new TRS-80s. In terms of simplicity and elegant design, the TRS-80 was probably the best computer in history. It used the Zilog Z-80 CPU, which had a vastly superior design to the Intel CPUs that unfortunately became the standard later. It was like a dream come true, switching from the Fortran-spewing teletypes to the new TRS-80s. Unfortunately, not everyone made the changeover ...

While the rest of us kids happily switched to the PCs, such as the TRS-80, Atari, Commodore 64, and Apple II, the grungy old Unix farts stubbornly kept programming on their teletypes and PDP-11s. They even mocked us, sneering at the "inferior" computing power of the "cheapo" PCs compared to the minicomputers they used. The kingpin of these smelly old university basement programmers was Stallman. We all know how that battle turned out: DEC, MIPs, Acorn, Control Data, Burroughs, Data General, and every other minicomputer company either went bankrupt or went out of production. They lost, but Stallman was not going to surrender, he was going down with the ship. The kids could use tab-festooned keyboards all they wanted, he was going to keep using spaces even if they amputated his thumbs. Stallman had invested thousands of hours creating specialized programs to automate indentation using spaces and he was not about to see that work go to waste.

The victims of Stallman's obsession were, of course, his allies: all the other Unix programmers. Like a dictator who wants his people to be buried in his own grave, Stallman became determined not only to never use tabs, but also to force everyone else to use spaces, as well. So, he altered the source code of Emacs and other Gnu programs in ways deliberately designed to make programming with tab indentation impossible and then started a sort of death cult around the use of spaces. Naive programmers who started programming in university environments during the 1990s got the full brunt of this anti-tab indoctrination and grew up convinced that spaces were a "better" way to indent, completely unaware of the history of the situation and Stallman's secret and perverted agenda. Even today this space cult lives on and browbeats anyone they can to use spaces. For example, at Google all the programmers are forced to use indents of exactly two SPACES and tabs are not allowed. This is because the tech leaders there are Unix dweebs that got brainwashed by Stallman's cult when they were college students in the 1990s. Of course, they are fighting a losing battle because now kids start programming at age 8, long before they go to university and they use PCs, so when the current cult dies off, their space-indentation macros will die with them.

As for myself, I switched to Vim fifteen years ago. In Vim, using tab indentation is a trivial one-line setting, so I have no problem.

return to John Chamberlain's home · diary index

Developer Diary · about · info@johnchamberlain.com · bio · Revised 28 January 2018 · Pure Content