Could Python supplant Java?
will at misconception.org.uk
Wed Aug 21 18:40:23 CEST 2002
On Wednesday 21 Aug 2002 5:13 pm, James J. Besemer wrote:
> The trade-off is that in exchange for pre declaring your types
> the compiler detects and helps eliminate this class of bugs even
> before you run your unit test. The cost of declaring ahead of
> time is small and the gain to be had (vs. debugging each of the
> corresponding runtime errors) can be significant.
IMO it's another case of the 80/20 rule. Syntax errors in C++ generally would
fall firmly in the 80% of bugs that take only 20% of the time to locate and
fix. As anyone who has debugged large quantities of C/C++ can tell you, just
because a program compiles it is not bug free, and the bugs that are likely
left are the hard ones to track down. If it came down to a straight trade-off
between a grabage-collected, pointer-less language and a statically typed
language with pointers I can guarantee that the debugging time of the former
will be far less than the latter. When you factor in interpreted versus
compile-link-debug type of systems you will see Python does not suffer from
being dynamically typed at all.
So yes, I agree that static typing can catch bugs, but they are usually quite
trivial typos or cut and paste errors (const excepted). However I also
believe that the reduced lines of code and development time mean that to code
and debug in Python is, in my experience, much faster than to code and debug
in C++ or C.
More information about the Python-list