[lug] Running a mixed Python environment

Steve Litt slitt at troubleshooters.com
Thu Sep 17 08:05:12 MDT 2020


On Wed, 16 Sep 2020 18:21:16 -0600
"Jed S. Baer" <blug at jbaer.cotse.net> wrote:

> On Wed, 16 Sep 2020 16:58:43 -0400
> Steve Litt wrote:
> 
[snip]

> Anyways, back then, you could inherit a program that'd already been
> modified by 3 or 4 folks who all had their own ideas about
> indentation and formatting. Standards? What?

THAT'S why, all other things being equal, I prefer significant leading
whitespace to braces or begin/end. With a Python program, no matter how
many people the code has gone through, subservient stuff lines up, and
it's easy to read, even if person 1 indented 8 spaces and person 2
indented 3 spaces. With braces or begin/end, run through several coders,
it can be very hard to know at a glance what's subservient to which.

> 
> > In a world where Vim has a way to make hard tabs look like 3 or 4
> > spaces, and external programs can do the same (or convert to 3 or 4
> > spaces), I don't see why tabs can't be used exclusively for
> > indentation.
> > 
> > Or alternatively, Vim can be set to substitute 3 space or 4 spaces
> > or whatever on every press of the Tab key, for an all-spaces
> > indentation.  
> 
> I'll argue that tabs have no place in source code. I suppose there are
> worse things, e.g. writing VBA in MS-Word.

For the most part, I'm not going to argue with you. To me, the most
important thing is not to mix them, and if you say all spaces is
better, I can't argue. With one exception...

When I designed VimOutliner, a project that started out as just me
throwing together an outliner as fast as possible. So I specified all
indentation uses tabs, so the tabs could be counted in Python or AWK or
Perl or whatever to quickly determine a level. There are no spaces in
the indents. It's worked out very well.

SteveT

Steve Litt 
Autumn 2020 featured book: Thriving in Tough Times
http://www.troubleshooters.com/thrive


More information about the LUG mailing list