| Store | Cart

Grouping code by indentation - feature or ******?

From: Bill Mill <bill...@gmail.com>
Fri, 25 Mar 2005 14:47:11 -0500
On Fri, 25 Mar 2005 11:38:37 -0800, Robert Kern <rkern at ucsd.edu> wrote:
> James Stroud wrote:> > On Friday 25 March 2005 08:39 am, Ivan Van Laningham wrote:> >> >>As far as grouping by indentation goes, it's why I fell in love with> >>Python in the first place.  Braces and so on are just extraneous cruft> >>as far as I'm concerned.  It's the difference between Vietnamese verbs> >>and Latin verbs;-)> >> >> > Say I buy into the indentation ideology. Python then has this inconsistency: :> >> > Why do we need : at the end of our if and for loops? I spend approximately 6> > minutes/100 lines of code going back and finding all of the times I missed :.> > Is it for cheating?>  >> > if False: print ":"> >> > Now, what happened to the whitespace idea here? This code seems very> > unpythonic. I think : is great for slices and lamda where things go on one> > line, but to require it to specify the start of a block of code seems a> > little perlish.> > During the usability studies for the language ABC, which Guido worked on> before developing Python and also used indentation for grouping, it was> found that the colon improved readability.> > I don't know what those studies said about the frequency of people> forgetting to put in the colon. Anecdotally, I can say that I do it very> rarely.> 

I can't remember having ever done it, although I am sure I have. The
real question is, though, 6 minutes per 100 lines of code? There
probably aren't more than 30 lines out of those 100 that should end in
a colon. Assuming you forget half your colons, you're spending upwards
of 20 seconds per colon?

If you want, I'll write a script that checks for colons at the end of
lines before increased indentation, and asks you if you want to put
one there - I could save you 5.8 minutes per 100 lines of code. How's
that for a productivity boost?

Peace
Bill Mill
bill.mill at gmail.com

Recent Messages in this Thread
Tim Tyler Mar 25, 2005 08:11 am
Peter Otten Mar 25, 2005 08:48 am
Skip Montanaro Mar 25, 2005 12:52 pm
Tim Tyler Mar 26, 2005 03:30 pm
Antoon Pardon Mar 25, 2005 12:56 pm
John Roth Mar 25, 2005 01:22 pm
Antoon Pardon Mar 25, 2005 02:26 pm
Antoon Pardon Mar 29, 2005 07:57 am
Antoon Pardon Mar 29, 2005 07:47 am
Roy Smith Mar 29, 2005 01:35 pm
Kent Johnson Mar 25, 2005 01:51 pm
Carl Banks Mar 25, 2005 02:15 pm
Antoon Pardon Mar 25, 2005 02:41 pm
Diez B. Roggisch Mar 25, 2005 03:02 pm
Antoon Pardon Mar 25, 2005 03:16 pm
Diez B. Roggisch Mar 25, 2005 03:33 pm
Antoon Pardon Mar 29, 2005 07:34 am
Diez B. Roggisch Mar 29, 2005 09:43 pm
Rocco Moretti Mar 25, 2005 05:21 pm
Tim Roberts Mar 26, 2005 09:03 am
Peter Otten Mar 26, 2005 10:29 am
Kent Johnson Mar 26, 2005 12:09 pm
Skip Montanaro Mar 26, 2005 12:41 pm
Peter Otten Mar 26, 2005 07:02 pm
Kent Johnson Mar 27, 2005 02:43 am
Peter Otten Mar 27, 2005 05:42 am
Reinhold Birkenfeld Mar 27, 2005 05:08 pm
projecktzero Mar 25, 2005 02:43 pm
Larry Bates Mar 25, 2005 04:15 pm
Ivan Van Laningham Mar 25, 2005 04:39 pm
James Stroud Mar 25, 2005 07:31 pm
Robert Kern Mar 25, 2005 07:38 pm
Bill Mill Mar 25, 2005 07:47 pm
Larry Bates Mar 25, 2005 09:56 pm
Jeremy Bowers Mar 26, 2005 05:50 am
Ron_Adam Mar 26, 2005 05:36 pm
Mike Meyer Mar 26, 2005 10:52 pm
Terry Reedy Mar 25, 2005 06:42 pm
Paul McGuire Mar 26, 2005 06:13 am
Javier Bezos Mar 26, 2005 09:02 am
Tim Tyler Mar 26, 2005 03:42 pm
Jeremy Bowers Mar 26, 2005 11:17 am
Jacob Lee Mar 27, 2005 07:00 am
Javier Bezos Mar 27, 2005 03:30 pm
Reinhold Birkenfeld Mar 27, 2005 05:11 pm
Javier Bezos Mar 27, 2005 06:04 pm
Myles Strous Mar 30, 2005 06:08 am
Myles Strous Mar 30, 2005 06:13 am
Javier Bezos Mar 30, 2005 06:00 pm
Javier Bezos Mar 28, 2005 06:05 pm
Reinhold Birkenfeld Mar 27, 2005 05:10 pm
Scott David Daniels Mar 27, 2005 09:41 pm
Terry Reedy Mar 30, 2005 01:55 am
Tim Roberts Mar 30, 2005 06:48 am
James Stroud Mar 26, 2005 11:36 pm
Terry Reedy Mar 25, 2005 06:41 pm
Messages in this thread