Help a C++ coder see the light
geoff at gerrietts.net
Sat Feb 1 00:25:32 CET 2003
You know, I've only sorta been following this thread, so I can't
respond to the original, and I can't be 100% sure my points haven't
already been raised, but that's not going to stop me from making them
(ooh, ouch, does this make me a bad person?)
The lack of type checking and name declaration in python offers great
flexibility, but it does come at a cost. The cost can largely be
mitigated by writing unit testing, and test-first development does
seem to result in shorter development cycles. This efficiency is even
higher in python, since it's easy to write unit tests (see another
opinionated post by me, dated today).
The lack of type checking and name declaration does present some
challenges, but nothing nearly as challenging as the memory management
issues offered by C++. Any way you want to draw the comparisons, these
pitfalls are by far worse, and the bigger the software project, the
more likely you'll encounter them. These errors are easier to
accidentally encounter, with things like implicit copy creation,
direct pointer management, and direct memory allocation. They are also
generally more severe, producing unrecoverable crashing defects, and
potentially generating mammoth-sized security holes.
Sometimes, I miss a type checker, especially since I've had trouble
getting many "favorite" python development tools to work with some of
my projects. Sometimes, I miss the ease of distribution offered by a
compiled program, or the execution speed.
But then I go spend some time programming in those other languages,
the ones I think I missed, and I remember why it is I like to write
all my code in Python. Some of it is about the dynamic flexibility,
but mostly, it's the lack of horrifying pitfalls.
If you're the sort who tends to fumblefinger the typing a couple times
a day, or the sort who never leaks memory or segfaults, or the sort
whose software designs are so brilliantly done that changes rarely
requires recompilation of more than a single file at a time -- if
you're one of a billion different sorts of programmers, that I am not,
you may find the type checking to be an insurmountable barrier. I
don't, and I'm willing to bet most won't.
Geoff Gerrietts "I am always doing that which I can not do,
<geoff at gerrietts net> in order that I may learn how to do it."
http://www.gerrietts.net --Pablo Picasso
More information about the Python-list