Typing system vs. Java

Mitchell Morris mitchell.morris at cingular.com
Mon Jul 30 07:43:40 EDT 2001


<brueckd at tbye.com> wrote in
news:mailman.996258291.15055.python-list at python.org: 
[snip]
> In most jobs I've used C/C++ or Java and for me the stronger the typing
> rules the more problems (and in turn bugs) it caused. I haven't sat
> down to really ponder why but I have noticed a few recurring problems.
> 
> One is that stronger types introduce a lot more complexity. In Java I
> spend a lot of time creating new classes just to act as simple data
> structures.  For example, if I need to store a list of points and color
> values I can't just make an array of (x,y,color) tuples. I need to
> create a class to hold them and then create instances and store them in
> an array or Vector. And darn it, if I want to pull them out of the
> Vector I have to cast them back to their class - even though both I and
> the objects in the Vector already know what they are.

I'll go out on a limb and say that C++ and Java don't really have strong 
typing, they merely have an unreasonable facsimile thereof.

Allow me instead to repeat some advice that once flew across this newsgroup: 
the timbot said (and I'm paraphrasing here) "If you want to see what strong 
static typing is supposed to feel like, try Haskell or OCaml." I've tried 
both now, and have discovered that they are both truly pleasant to work 
with, and are refreshingly free of all the why-do-i-have-to-type-a-cast-
when-we-both-know-damn-well-what-this-is events that otherwise plague C++ 
and Java development.

    	Haskell: <http://www.haskell.org/>
    	OCaml: <http://www.ocaml.org/>



[snip]
> If nothing else, for large projects the Python versions are much
> smaller and simpler, and as a result are usually less buggy and easier
> to manage. 
> 
> -Dave

otherwise-in-complete-agreement-ly y'rs,
+Mitchell



More information about the Python-list mailing list