Deprecate tabs for indenting (was Re: Indenting with tabs vs spaces)

Paul Boddie paul at boddie.net
Tue Dec 4 05:39:19 EST 2001


Steve Lamb <grey at despair.dmiyu.org> wrote in message news:<slrna0nn1g.gi5.grey at teleute.dmiyu.org>...
> On Mon, 03 Dec 2001 19:34:25 GMT, Erik de Castro Lopo <nospam at mega-nerd.com>
> wrote:
> > How hard is it to find an editor that treats tabs correctly and allows
> > the tab width to be set to something other than 8?
> 
>     Quite easy, which is the problem.  Or are you ignoring my rather basic but
> not uncommon example of code which gets messed up when people are able to
> modify indention levels.

If you have a file which uses only "hard tabs" for indentation, and
someone then modifies their indentation level in an editor which
supports "hard tabs", and that person then uses "hard tabs" to indent
code in that file, then there isn't a problem.

If, on the other hand, someone loads the file into such an editor and
starts slapping the space bar to indent code, then you do have a
problem. One might ask who caused that problem but, for the sake of
objectivity, it's much better to discuss what kind of procedures you
have around the development of your code to prevent this from
happening.

Even if it does sound extreme, rejecting files with "hard tabs" in it
does constitute a solution, and there are ways that people can still
choose their indentation style within this framework. If you can't
handle such issues, yet have the time or inclination to flame others
about what you perceive to be the cause of such issues, then I suggest
you redirect your energy towards investigating those issues and
possible solutions more closely, if only because "tabs vs. spaces"
isn't the only pitfall you're going to encounter when dealing with
source code in a multi-developer environment.

Paul



More information about the Python-list mailing list