static/dynamic typing (was Re: Spoon progress 15 April 2006: inert
method deletion details etc.)
Dave Mason
dmason at sarg.ryerson.ca
Tue Apr 18 13:53:02 UTC 2006
Bert Freudenberg wrote:
> Actually I have heard exactly this statement from students - "it
> compiles, so it must be right". The compiler's type checking is there
> so you can only write correct programs, right?
This is actually almost true in ML or Haskell (functional-programming
languages), where you actually have a powerful, completely-static type
system. 90+% of the time the only errors would be off-by-one or other
indexing-type errors (the type system does not address array or list
sizes). Mind you, this was true for some very good programmers (I had
about 25 years experience at the time) who certainly weren't programming
by random code permutation.
Unfortunately, Java (and any other known OO language) doesn't have
nearly strong enough static type systems (the
co-variance/contra-variance problem). That's why I've always been a
proponent of dynamic typing for OO. (And even in the functional world,
I could never really decide between Scheme (dynamic) and ML (static).)
../Dave
More information about the Squeak-dev
mailing list
|