An unspeakable act
aleaxit at yahoo.com
Wed Jul 11 12:14:14 EDT 2001
"James Logajan" <JamesL at Lugoj.Com> wrote in message
news:3B4C76A3.A624D05F at Lugoj.Com...
> Hmmm. Any language design that aspires to allow programmers the ability to
> express algorithms independent of the type of object to which it may be
> applied, such as containers, must at some level provide typeless handles.
...or genericity, as in C++ templates. Genericity is typically
"solved" at compile-time (or link-time, for languages in which
that makes a difference), so typechecking may still have some
use there (you can get some error messages earlier than you would
if the checks were all done at runtime; performance-wise, that's
even more important -- the more loop-things-up work is done at
compile-time, the better). But in practice programming generic
C++ "feels" a LOT like programming ordinary Python (except for
the syntax cruft:-), at least to this respondent -- signature
based polymorphism being commonality number one.
The lack of genericity in Java (I've been heard that it was due
to be fixed "soon" for a few years now -- I've even used a good
genericity-on-top-of-Java thingy called Pizza, but it was so
clearly stamped as experimental that there was no chance I could
use it for production work) is, IMHO, its #1 current defect.
Casting Object references isn't really comparable...:-)... it
WOULD be very similar to trying to use void* in C++ as a
substitute for templates!-)
More information about the Python-list