Generics

Göran Krampe goran.krampe at bluefish.se
Sun Sep 28 22:53:21 UTC 2003


Hi all!

Ah, type discussions... Almost as yummy as inheritance discussions...

Citerat från Phil Hudson <phil.hudson at iname.com>:
> >On Sun, Sep 28, 2003 at 01:05:13AM +0100, Phil Hudson wrote:
> >> Are generic/template/parameterized/typesafe collections available in
> >> Smalltalk? 

The problem here is that Smalltalk being a dynamically (vs statically) typed
language it becomes very hard to do compile time analysis of the code and
through that come up with any compile time type errors. So the notion of
generics/templates/whatever simply have very little *compile time* meaning in
Smalltalk.

Smalltalkers (and other developers fond of dynamically typed languages) have
generally found that not having to type all that crude static stuff (and retype
it when refactoring etc, cascading dependency changes blabla) gives us much more
time to do more important stuff. We spend that extra time finding the *real*
bugs instead - for example by writing good unit tests or whatever. So for us the
advantages of dynamic types clearly outweighs the disadvantages. (I am
generalizing here of course)

There have been at least one major investigation that (if my memory serves)
showed that only 3% of the errors that the developers made when developing a
system was found by the compiler using static type checking. I would guess that
the overhead of maintaining that static type system in the code took much more
time than it was worth.

Ok, finally - I do not want to participate in a "static vs dynamic types"
discussion - and definitely not in this forum :-).

I have been involved in those for so many times and have come to the conclusion
that discussing it with people who only have experience with one side of the
coin (mostly the "static types" side) doesn't lead anywhere. I have programmed
in C/C++/Java/Smalltalk and many other languages - so I know both sides.

regards, Göran

Göran Krampe, goran.krampe at bluefish.se
GSM: +46 70 3933950, http://www.bluefish.se
Smalltalk - a place where objects live, not a language.



More information about the Squeak-dev mailing list