Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Regarding coding style

Reply
Thread Tools

Regarding coding style

 
 
K Viltersten
Guest
Posts: n/a
 
      03-07-2008
I've been recommended reading of:
http://www.python.org/dev/peps/pep-0008/
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

 
Reply With Quote
 
 
 
 
Simon Brunning
Guest
Posts: n/a
 
      03-07-2008
On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <(E-Mail Removed)> wrote:
>
> 1. When writing English, Strunk and
> White apply.


I apply Fowler, PEP 8 be damned.

--
Cheers,
Simon B.
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.brunningonline.net/simon/blog/
 
Reply With Quote
 
 
 
 
Richard Brodie
Guest
Posts: n/a
 
      03-07-2008

"K Viltersten" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

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


 
Reply With Quote
 
D'Arcy J.M. Cain
Guest
Posts: n/a
 
      03-07-2008
On Fri, 7 Mar 2008 17:31:35 +0100
"K Viltersten" <(E-Mail Removed)> wrote:
> I've been recommended reading of:
> http://www.python.org/dev/peps/pep-0008/
> 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 <(E-Mail Removed)> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
 
Reply With Quote
 
D'Arcy J.M. Cain
Guest
Posts: n/a
 
      03-07-2008
On Fri, 7 Mar 2008 16:44:10 +0000
"Simon Brunning" <(E-Mail Removed)> wrote:
> On Fri, Mar 7, 2008 at 4:31 PM, K Viltersten <(E-Mail Removed)> 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 <(E-Mail Removed)> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
 
Reply With Quote
 
Jeff Schwab
Guest
Posts: n/a
 
      03-07-2008
K Viltersten wrote:
> I've been recommended reading of:
> http://www.python.org/dev/peps/pep-0008/
> 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/elofstilbywi.html


> 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.)
 
Reply With Quote
 
Jon Ribbens
Guest
Posts: n/a
 
      03-07-2008
On 2008-03-07, D'Arcy J.M. Cain <(E-Mail Removed)> 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).
 
Reply With Quote
 
Grant Edwards
Guest
Posts: n/a
 
      03-07-2008
On 2008-03-07, Jon Ribbens <(E-Mail Removed)> 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
 
Reply With Quote
 
K Viltersten
Guest
Posts: n/a
 
      03-07-2008
>> 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

 
Reply With Quote
 
D'Arcy J.M. Cain
Guest
Posts: n/a
 
      03-07-2008
On 7 Mar 2008 17:40:08 GMT
Jon Ribbens <(E-Mail Removed)> 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 <(E-Mail Removed)> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need advices regarding the strings (str, unicode, coding) used asinterface for an external library. jmfauth Python 2 11-23-2010 02:02 PM
regarding coding using signal assignment.......... ekavirsrikanth@gmail.com VHDL 2 11-06-2006 04:28 AM
general coding issues - coding style... calmar Python 11 02-21-2006 10:36 AM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
style for coding latches Paul Baxter VHDL 7 08-15-2003 06:19 PM



Advertisments