Elastic tabstops: make tabs behave like table cells, not fixed columns

The old fight, revisited
Programmers have argued about tabs vs spaces for decades. We've all been there — bikeshedding over indentation, squinting at misaligned columns, switching fonts and watching the world fall apart. The traditional model treats a tab as “move to the next Nth column”, a relic of character-mapped displays. That mod‑N approach only works if everyone agrees on N and uses a monospace font. Want proportional fonts? Good luck. The result: both camps can point to real problems. Frustrating? Absolutely. Time-consuming? Yep. Worth the arguments? Debatable.
The proposal: tabs as delimiters
Enter elastic tabstops. Rather than fixing tabs to preset column widths, this idea treats each tab like a delimiter between table cells — think TSV for text and code. Each cell ends with a tab; a column block is a vertical run of cells and is as wide as the widest cell in that block (plus padding). The payoff is immediate: columns stay aligned even when people use different tab widths or proportional fonts, and simple edits or sed substitutions don't wreck layout. It’s conceptually elegant. It’s also a little more work for the editor, but then again — editors have gotten smarter.
Where to try it and why it matters
The original writeup shipped demos and a Java applet; it has been reported that modern browsers no longer support unsigned applets, so that live demo is harder to run today. The author points to Elastic Notepad and archived Java versions for those who want to experiment or inspect the core code. The practical wins are clear: fewer language‑specific alignment hacks, compatibility with proportional fonts (hello, Acme and Smalltalk fans), and less time lost to the tiny, bitter flame wars. So the next time someone invokes the sacred "tabs vs spaces" battle cry, ask a better question: why not treat tabs as columns?
Sources: nick-gravgaard.com, Lobsters
Comments