smalltalk

Talk about timing!

December 20, 2002 8:27:53.231

No sooner do I re-enter the dynamic/static fray here when this shows up in comp.lang.smalltalk:

As we all have found out (latest when reading this thread ;-) is that there are at least two big philosophies in programming languages: static typing and dynamic typing. While many people make a white/black distinction between these two claiming one or the other side is inherently bad, I cannot agree. IMO programming languages are all in an early stage of development, and I feel disadvantages in all of them. ATTENTION static typing stuff ahead: Regarding generics, while uselesss for dynamic type languages, are important in statically typed languages, as they are the only way to solve certain problems. E.g. you have an AbstractBuffer superclass with ByteBuffer and IntBuffer subclasses. You will then can write a
int getNext(); in IntBuffer and a byte getNext();
each dealing with its particular buffer. With generics, there is only one method. I agree fully that Generics do not solve everything. Another big issue is that types cannot be refined in subclasses (this is even more painfull than the problems solved by generics). A good example is Object.clone(); Any subclass can override, but they all are forced to return Object instead of their type, leading to ugly code like e.g. ByteBuffer copy = (ByteBuffer) myByteBuffer.clone(); //yucc This one is particularly hurting when designing class hierachies. Also, it apparently drops back to runtime type checking, static types are merely a burden. (BTW: these two problems are on (1) and (3) in the java RequestForEnhancement list). Apparently all this is absent in dynamic type languages.

 Share Tweet This
-->