[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Regarding coding style

K Viltersten

3/7/2008 4:32:00 PM

I've been recommended reading of:
http://www.python.org/dev/peps...
and in there i saw two things that i
need to get elaborated.


1. When writing English, Strunk and
White apply.

Where can i download it? Am i actually
expected to read the whole book? How
many people actually do aply it?


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.


Thanks for the input in advance.

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

67 Answers

Simon Brunning

3/7/2008 4:44:00 PM

0

On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <tmp1@viltersten.com> wrote:
>
> 1. When writing English, Strunk and
> White apply.

I apply Fowler, PEP 8 be damned. ;-)

--
Cheers,
Simon B.
simon@brunningonline.net
http://www.brunningonline.net/s...

Richard Brodie

3/7/2008 4:48:00 PM

0


"K Viltersten" <tmp1@viltersten.com> wrote in message
news:63d80bF273nraU1@mid.individual.net...

> 1. When writing English, Strunk and White apply.

Do they? I've never seen them ;)

> 2. You should use two spaces after a sentence-ending period.
>
> For heavens sake, why?

Most people find it easier to type two spaces than one and a half.


D'Arcy J.M. Cain

3/7/2008 4:59:00 PM

0

On Fri, 7 Mar 2008 17:31:35 +0100
"K Viltersten" <tmp1@viltersten.com> wrote:
> I've been recommended reading of:
> http://www.python.org/dev/peps...
> and in there i saw two things that i
> need to get elaborated.
>
>
> 1. When writing English, Strunk and
> White apply.
>
> Where can i download it? Am i actually
> expected to read the whole book? How
> many people actually do aply it?

"The Elements of Style" by William Strunk Jr. and E.B. White. The
original, revised edition was published in 1935. The third edition is
copyright 1979 and published by MacMillan Publishing Co., Inc., NY,
NY. There may be a later version with an ISBN but this one doesn't
have one.

It's a very small book, 4-1/2" by 7", 81 pages. If you are writing
English it is worth browsing from time to time.

> 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.

--
D'Arcy J.M. Cain <darcy@druid.net> | Democracy is three wolves
http://www.druid.... | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

D'Arcy J.M. Cain

3/7/2008 5:02:00 PM

0

On Fri, 7 Mar 2008 16:44:10 +0000
"Simon Brunning" <simon@brunningonline.net> wrote:
> On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <tmp1@viltersten.com> wrote:
> >
> > 1. When writing English, Strunk and
> > White apply.
>
> I apply Fowler, PEP 8 be damned. ;-)

Fowler's is good too but much more comprehensive. Strunk and White is
a pamphlet compared to Fowler's tome.

--
D'Arcy J.M. Cain <darcy@druid.net> | Democracy is three wolves
http://www.druid.... | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

Jeff Schwab

3/7/2008 5:12:00 PM

0

K Viltersten wrote:
> I've been recommended reading of:
> http://www.python.org/dev/peps...
> and in there i saw two things that i need to get elaborated.
>
>
> 1. When writing English, Strunk and White apply.
>
> Where can i download it? Am i actually
> expected to read the whole book?


It's a short book, and worth your time. Searching does turn up free
downloads, but I recommend the illustrated version (of which I own a copy).

http://www.libraryshop.org/elofsti...


> How many people actually do aply it?

The problem is how many people don't.


> 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.

(a) It makes the ends of sentences more visually obvious.
(b) It makes text easier to parse reliably from scripts.
(c) Some text-editors can navigate such sentences out of the box,
whereas others cannot. (I recall this limitation with Emacs'
text-editing major mode, though it may have been fixed since then; I
switched to Vim about five years ago.)

Jon Ribbens

3/7/2008 5:40:00 PM

0

On 2008-03-07, D'Arcy J.M. Cain <darcy@druid.net> 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.

Well, no, it's to follow a particular person's choice out of the many
and various competing rules of "correct English usage". Personally,
I dislike double spaces after sentences, but it is not wrong to put
them there any more than it is wrong not to put them there.
Consistency is far more important (hence the rule, I presume).

Grant Edwards

3/7/2008 5:49:00 PM

0

On 2008-03-07, Jon Ribbens <jon+usenet@unequivocal.co.uk> wrote:

> Personally, I dislike double spaces after sentences, but it is
> not wrong to put them there any more than it is wrong not to
> put them there.

You're lucky my high school typing teacher didn't hear you say
that...

--
Grant Edwards grante Yow! I joined scientology
at at a garage sale!!
visi.com

K Viltersten

3/7/2008 6:05:00 PM

0

>> 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.
>
> (a) It makes the ends of sentences more visually obvious.
> (b) It makes text easier to parse reliably from scripts.
> (c) Some text-editors can navigate such sentences out of
> the box, whereas others cannot.

Got it. Thanks. :)

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

D'Arcy J.M. Cain

3/7/2008 6:09:00 PM

0

On 7 Mar 2008 17:40:08 GMT
Jon Ribbens <jon+usenet@unequivocal.co.uk> wrote:
> Well, no, it's to follow a particular person's choice out of the many
> and various competing rules of "correct English usage". Personally,
> I dislike double spaces after sentences, but it is not wrong to put
> them there any more than it is wrong not to put them there.
> Consistency is far more important (hence the rule, I presume).

Warning: Opinion follows possibly influenced by insufficient research.

I have read the arguments about single or double spacing and find that
they can be distilled down to the following:

You should use double space for monospaced fonts and single for
proportional. I reject this argument for two reasons. One is
consistency. It is entirely possible for the same document to be
rendered in multiple ways and you may not be aware of them ahead of
time. The second is that it seems to me that programs that use
proportional fonts should be able to make any space between sentences
render properly by their own rules so the number of spaces should be
irrelevant. I am not swayed by arguments that they don't handle this
properly yet.

The arguments for one over the other fall into these basic ones. Use
double spaces to make the document easier to read, especially by people
who read a lot and tend to skim to absorb as much information as
possible. Use single space because it makes the document display
nicer. This suggests to me that the schism is probably between two
different types of people, text/information oriented and
display/presentation oriented. I don't see any way to appeal to both.

--
D'Arcy J.M. Cain <darcy@druid.net> | Democracy is three wolves
http://www.druid.... | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.

K Viltersten

3/7/2008 6:13:00 PM

0

>> Personally, I dislike double spaces after
>> sentences, but it is not wrong to put them
>> there any more than it is wrong not to put
>> them there.
>
> You're lucky my high school typing teacher
> didn't hear you say that...

I'm unclear if your teacher was a double or
single spacer. It's only implied that he
felt strongly one way.

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy