[Python-Dev] Re: decorators and 2.4

Paul Prescod paul at prescod.net
Fri Jun 25 11:40:15 EDT 2004


Bill Janssen wrote:

>...
> 
> Yeah, it makes the code marginally easier to edit, but it also makes
> the code harder to read.  Used to be that "def" and "class" would
> stand out in the file, being at the left edge.  Now you've got these
> new lines, with, God help us, new syntax, cluttering up the left edge.

The left edge is already cluttered.

a = 5
b = a()
def foo(xyz):
     abc = 5
c = 20

It is the indentation that alerts your eye to the function definition.

> What's even worse, these decorators come before the function, so you
> encounter them before you even know what function you're talking
> about.  A reading nightmare.

Nobody reads code one line at a time from the top down. You scan for the 
bit that interests you and then look around for its context.

  Paul Prescod





More information about the Python-Dev mailing list