Could Python supplant Java?
joeking at merseymail.com
Tue Aug 20 09:20:27 EDT 2002
laotseu <bdesth at nospam.free.fr> wrote in message news:<3D61A538.2050107 at nospam.free.fr>...
> I used to think the same (what about VB's 'variant' ? yuk !)... But
> python's dynamic typing has got me, specially in the case of oo
> programming. It makes polymorphism a really simple thing.
And more dangerous :-)
> IMHO, compile time type-checking is a nice safety net, but if you get a
> type error at compilation, it still means you made a mistake.
Yes, but the error is flagged in compilation, as opposed to
five weeks after the product ships, when it crops up in a bug
report from a customer.
Strong and weak typing have their place. Dynamic types are less
hassle to work with, but of course they push an added burden of
testing onto the developer - because mistakes are not so easily
spotted. However, for languages targetted maining at scripting
(scripts tend to be brief by their very nature) then the added
burden of dynamic typing is managable, and the benefits often
outweigh the problems.
This is one of the reasons why I do not consider Python a suitable
alternative to Java. Dynamic typing is fine for scripts, but when
it comes to full-blown 'ten thousand line' applications you really
should be looking as something IMHO which gives you the added
security of strong typing, to catch as many potential bugs as
> BTW, even
> in C, you can have type error when casting a void*, and you don't have
> any info about the original type of the pointeur. Dynamic typing doesn't
> means Python is not *strongly* typed.
Surely the two are mutually exclusive? Unless this is some very
novel use of the word 'strongly'? :-)
More information about the Python-list