Elastic tabstops

Tim Hubberstey timh at marmot-eng.com
Mon Jul 17 12:15:33 CEST 2006


Joachim Lous wrote:
> This a very very old debate, if not to say holy war.
> [snip]
> But if one sets ambitions a little lower, there is actually one system
> that ensures the code will at least always _look_ comprehensible
> wherever you open it, and that system is spaces-only indentation.
> Granted, you might then encounter varying indent widths in various
> secions, and it might not be your favourite one, but at least you will
> see the code as the author intended/indented :) it, and avoid the
> unpredictable messes you get when the original uses a mix of spaces
> and one or several tab sizes different from your own.
> 
> In the old days this might have a serious downside in that it was hell
> to work with in editors, but these days when all mature code editors
> can emulate tabs quite well, it has little impact on how the work
> feels, while retaining the above mentioned robustness of presentation
> (which is probably _why_ they all support it).
> 
> Also, as with any scheme, one is of course free to use any system at
> all during work, as long as it is sanely converted before checkin.

Summed up beautifully, Joachim.

It is important to realize that the tab character was used as a 
substitute for spaces primarily because it consumed less precious 
storage and bandwidth, not because it was better. Now, with disk space 
going for around $0.40/GB (and dropping) and 100BaseT Ethernet common, 
there is no reason to worry about trying to conserve space.

Every company I've written code for from about 1985 on has had a policy 
of "no tabs in checked in code". The only exceptions are makefiles 
because of the bizarre requirement that tabs must be used. If I ever 
encounter a source file with tabs in it, the very first thing I do is 
figure out what tab spacing the author intended and then run the file 
through 'expand' to get rid of the tabs.

In my opinion, there are more important issues facing NEdit than 
something like this.
-- 
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . .  VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada  . . . . . . . . . . . http://www.marmot-eng.com



More information about the Discuss mailing list