One tab is two spaces
My adventures in programming started back in 1998 with a primitive text editor
called (gasp!) MS-DOS edit
. This editor had no automated indenting facilities, so I was forced me
to manually indent my source code. Under such circumstances, indenting with
tabs was naturally more economical than indenting with spaces, because with
just one press of the tab key, I could produce the effect of pressing the
space bar eight times!
During my senior year of high school, I was luckily introduced to the fabulous jEdit text editor, which serves as my programming text editor to this day. Like Emacs and Vim, it could:
- display tabs using a configurable number of spaces
- insert a configurable number of spaces when the tab key is pressed
- indent and unindent one or more lines of code
However, I soon felt that tabs were too wide. So I configured my editor to display tabs with four spaces instead, and discovered that I could see much more code in the same display than previously possible! Eventually, I came to prefer the display of tabs as two spaces. As before, this increased the visual density of code while maintaining the benefits of readability introduced by indenting.
Today, after six years of indenting purely with tabs, I somehow made the switch to spaces! Though it seems monumental, my programming habits remain virtually unchanged. Except now, I use the editor’s magic to unindent, instead of pressing the back space key.