PEP8 and 4 spaces

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Jul 7 04:28:38 CEST 2014


On Mon, 07 Jul 2014 11:00:59 +1000, Ben Finney wrote:

> The makefile syntax is one of the excellent examples of why it's a
> terrible idea to use tab characters in source code.

Hmmm... I'm not sure that conclusion follows. I think that makefile 
syntax is an example of why it is a terrible idea to give spaces and tabs 
different semantics, not that tabs themselves are harmful.


> It's also an
> excellent example of how a poor design decision (a line beginning with
> U+0020 SPACE is semantically different from a line beginning with U+0009
> CHARACTER TABULATION) can be irrevocable

Yes. Design your public APIs cleanly and clearly from the start.

The story of makefiles is a warning of the dark side to "release early, 
release often", and the dangers of using alpha software in production:

[quote]
Why the tab in column 1? Yacc was new, Lex was brand new. I hadn't tried 
either, so I figured this would be a good excuse to learn. After getting 
myself snarled up with my first stab at Lex, I just did something simple 
with the pattern newline-tab. It worked, it stayed. And then a few weeks 
later I had a user population of about a dozen, most of them friends, and 
I didn't want to screw up my embedded base. The rest, sadly, is history.
-- Stuart Feldman 
[end quote]




-- 
Steven



More information about the Python-list mailing list