The Industry choice

Aahz aahz at pythoncraft.com
Sun Jan 2 12:03:50 EST 2005


In article <41d6ee45$1_2 at 127.0.0.1>, Donn Cave <donn at drizzle.com> wrote:
>
>I can only believe that if you think the benefit of static typing is
>psychological, either something is very different between the way you
>and I write programs, or you're not doing it right.
>
>For me, the effect is striking.  I pound out a little program, couple
>hundred lines maybe, and think "hm, guess that's it" and save it to
>disk.  Run the compiler, it says "no, that's not it - look at line 49,
>where this expression has type string but context requires list string."
>OK, fix that, iterate.  Most of this goes about as fast as I can edit,
>sometimes longer, but it's always about structural flaws in my program,
>that got there usually because I changed my mind about something in
>midstream, or maybe I just mistyped something or forgot what I was doing.
>Then, when the compiler is happy -- the program works.  Not always, but
>so much more often than when I write them in Python.

That's just not true for me.  Take my recent Java experience (please!).
I spent much effort trying to resolve stupid type dependencies that made
no sense.  Python's duck-typing just works -- if it looks like you should
be able to use an object for a particular operation, you probably can.
Python programs that I write mostly just work; instead of pounding out
two hundred lines of code straight, I keep adding stubs and filling them
in, testing operation as I go.  This isn't even unit-testing -- I haven't
drunk that Kool-Aid yet.

This is easy because running a Python program is faster than invoking the
Java compiler -- and you still haven't tested the actual operation of
your Java program.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"19. A language that doesn't affect the way you think about programming,
is not worth knowing."  --Alan Perlis



More information about the Python-list mailing list