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

Courageous jkraska at san.rr.com
Wed Dec 5 11:56:31 EST 2001


>Can you give an example of how spaces must creep in on continuation
>lines?

##--snip; not in particular the column-positioning of the "or". If
##        tabs are used here, it will be misaligned with other
##        tabstop stettings for certain

    if isinstance(f, future.Step)          or \
       isinstance(f, future.Status)        or \
       isinstance(f, future.Announce)      or \
       isinstance(f, possibility.Observe)  or \
       isinstance(f, future.Incarnate)     or \
       isinstance(f, future.Start)         or \
       isinstance(f, future.Timeout):
                 
##--snip; in this case, the continuation line is lined up on the
##        string boundary to create some congruity between the code
##        and the message produced

    log.Fatal("Unexpected RETURN intercepted from user code.\n"
              "This is almost certainly due to an inappropriate explicit\n"
              "or implicit use of return in an Task. HINT: Make sure\n"
              "to use Fail(), End(), or Succeed() to terminate a Task,\n"
              "The most suspicious task is probably this one:\n\n"+lastFuture.String())

##--snip; here, like the or, the actions are put into a column.
##        simple actions, organized like this are both compact and
##        readable.

        if methodname==self.task.name:         methodname="-"
        else:                                  methodname=methodname[0:20]+"()"
  
        if self.task.status:                   stat=status.strings[self.task.status]
        else:                                  stat="UNKNOWN"

        if self.absoluteT == simulator.ticks:  when="now"
        else:                                  when="future"

>                am aware that there's a lot of hostility to tab
>usage in various open source projects, but that's really a consequence
>of the tools around on many platforms today.

I don't think so. Even word will get fucked up if someone tweaks
the positioning of the tabs in the ruler. The reason this problem
doesn't make itself more evident is that the document carries its
tabstops with it.

You can do this in vim at the beginning of the document, by the way.
E.g.,

##------------------------------------------------------------------------------
##  $Id: resource.py,v 1.1 2001/12/05 00:44:27 jkraska Exp $
##  vim: ts=8
##------------------------------------------------------------------------------

C//




More information about the Python-list mailing list