Why so few Python jobs?

Harry George hgg9140 at seanet.com
Tue Sep 25 18:57:27 EDT 2001


tim at vegeta.ath.cx (Tim Hammerquist) writes:

> Me parece que Peter Hansen <peter at engcorp.com> dijo:
> > Tim Hammerquist wrote:
> > >
> > > A good argument.  One of my favorite things about Python is that I never
> > > run the risk of having to maintain code like this:
> > > 
> > > sub myfunc {
> > > do_stuff();
> > > do_some_more_stuff();
> > > $screw = with @some_variables;
> > > for $item (@some_variables){
> > > do_stuff();
> > > and_some_more(); }
> > > do_a_bit_more();
> > > blah;
> > > }
> > 
> > What's so bad about this?!
> 

Try some code I get to maintain on occasion.  Which may be fair, since
I was the one who convinced the support staff to use perl in the first
place.  One "first effort" perl script has grown to be the basis for
dozens of web-launched batch tasks run all over the world.  It does
not use "-w", "use strict", or "use English"; it has every variant of
trailing conditional; and the indentation is random.  The script is
imported by other scripts where it generates another perl script which
generates Lisp which generates DQS calls.  Peer code reviews are of
the form "What the heck does this line do???" (BTW: The author was a
very bright buy...bright enough to create it and bright enough to know
it needed rewriting.  But mgmt didn't undertand the need.  So he left
the company to avoid maintaining it.)

I'll also admit to writing a perl script which generates a perl script
which generates a noweb literate programming package for documenting
prolog code.  But at least that one was (literally) self documenting.

Metaprogramming in python on the other hand is peaceful.

> Heh.  Good thing you didn't ask me when I had to maintain this code. I
> would've bitten your head off...so to speak...I hope.  <wink>
> 
> > It's just indentation with a tabsize of zero... ;-)
> > 
> > -is-that-really-<shudder>-perl?-ly yr's,
> 
> It parses, yes.  But C code of the same format would parse as well.
> However, no instructor I've ever had would have accepted it.  They'd
> have said, "Rewrite the code structure, turn it back in, and accept a
> 10% deduction from the final score for late work.
> 
> No Perl module from CPAN has this form, nor any code posted to c.l.p.m
> (other than from newbies).  Larry Wall suggests a 4-wide tabs with open
> and closing braces in corresponding columns.  The above code would
> result in:
> 
> sub myfunc
> {
>     do_stuff();
>     do_some_more_stuff();
>     $screw = with @some_variables;
>     for $item (@some_variables)
>     {
>         do_stuff();
>         and_some_more();
>     }
>     do_a_bit_more();
>     blah;
> }
> 
> (at which point the Python side of my brain kicks in and says, "Well,
> there's two perfectly good screen lines wasted with one character...")
> 
> <why-do-you-think-Python-is-so-oft-recommended-in-c.l.p.m>-ly yr's,
> Tim
> 
> -- 
> I'm already not yet convinced.
>     -- Larry Wall

-- 
Harry George
hgg9140 at seanet.com



More information about the Python-list mailing list