Regarding coding style

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Mar 7 22:16:45 CET 2008


On Fri, 07 Mar 2008 11:58:38 -0500, D'Arcy J.M. Cain wrote:

>> 2. You should use two spaces after a
>> sentence-ending period.
>> 
>> For heavens sake, why? I've always been obstructed by the double blanks
>> but
>> tolerated them. Now, that i read that it actually is a recommendation,
>> i need to ask about the purpose.
> 
> Like many things of this nature, the purpose is to follow the rules of
> correct English usage.

Except English grammar does not and never has specified using two spaces 
after a period. The (bad) habit of doing so was introduced by typists, in 
the old days of manual typewriters, in the belief (completely bogus, in 
my opinion) that a larger gap between sentences would make them more 
readable. I believe that the larger gap is a distraction, one of the 
reasons that typewriter text is generally harder to read than properly 
typeset text.

I believe it is one of those things that everybody (for some value of 
"everybody") does because that's what they were taught to do, and they 
were taught to do it because that's what their teachers were taught, and 
so on all the way back to some nutter who just decided that *he* was 
going to use two spaces after a period because the Great and Mighty 
Pumpkin told him to.

Professional typesetters, using proportional fonts, don't use double-
spaces because it throws off word spacing and line justification and just 
plain looks ugly. I suppose that since coders typically use non-
proportional fonts, we can at least justify the use of two spaces with a 
claim that it aids readability for "typewriter fonts" -- if you believe 
such a thing, which I do not.



-- 
Steven



More information about the Python-list mailing list