Python from Wise Guy's Viewpoint

Marshall Spight mspight at dnai.com
Sat Oct 25 10:49:44 EDT 2003


"Joachim Durchholz" <joachim.durchholz at web.de> wrote in message news:bndsch$764$1 at news.oberberg.net...
> Marshall Spight wrote:
>
> > Downcasts in Java are not a source of problems.
>
> Huh?
> Alone the need to downcast whenever I take something out of a container
> would suffice to term it as a "serious problem".

Why? Here, you've assumed your conclusion. You've not given
me any reason. I will not accept any a priori criticisms of
downcasting except this one: downcasting requires the programmer
to type more characters.

Downcasts are not a source of problems in Java because
empirically, no problems result from them. (It's hard to
prove the absense of something, eh?) Years pass; hundreds
of thousands of lines of code are written, with no errors
arising from downcasting the result of ArrayList.get().
That has been my experience.

Does the existence of downcasts point out a place where
Java is lame? Absolutely. Does extra effort result from
this lameness? Certainly. Does this extra effort cause
bugs? Nope.

(Anyway, the situation is much better with Java generics,
available now in prerelease form; mainsteam in the next
major version.)


Marshall






More information about the Python-list mailing list