I have been using
ed lately due to resurrecting a DECwriter IV for use with my PDP-11s, and it has caused me to reflect upon editing styles. I previously spent some time thinking about this when bringing up Unix V6 on said machines.
One inescapable conclusion from this experience is that tabs-versus-spaces is a thoroughly “modern” argument, brought about by the ready availability of video terminals with screen editors and automatic formatting capabilities. When you’re using
ed, it is obvious that indentation is done with tabs, and only tabs, and carefully lining up columns for continuations and other clever uses of spaces are just unreasonable.
This explains K&R style. In a different sense, it also explains the almost completely uniform style of modern Lisp; Lisp editors use Emacs, and Emacs formats Lisp thus, and so Lisp is formatted thus. Of course, the end game for such an argument that tools influence code formatting is Go, with
gofmt. As Rob Pike says,
gofmt's style is no one’s favorite, yet
gofmt is everyone’s favorite.
Could Python have arisen in its current form in a world of
ex? I think probably not. For myself, I’m a four spaces guy — unless I’m using a printing terminal, or Unix Version 6.