About KCP and automatic initialize

Noury Bouraqadi bouraqadi at ensm-douai.fr
Mon Sep 15 07:50:52 UTC 2003


Here are few observations I made when cleaning the image to introduce
the pattern new-initialize.
(1) In the "basic" image that I cleaned up I found arroud 80
redefinitions of new just for calling initialize!
(2) If by default new does not call initialize (as it is now in Squeak),
people can do mistakes. I found 2 or 3 subclasses where the #new method
have bee redefined to "super new initialize" while the #new of the
superclass does the same thing (i.e. sending initialize to the newly
created instance). So, there is a duplicated call of initialize that may
lead to undesirable side-effects.

Observation (1) is a prove that people do really need having new trigger
initialization. By not providing it, we make people do duplicate code.
Observation (2) demonstrate that this duplication not only is space
consuming, but its error prone....
So, my conclusion is that *we need* to have new trigger initialization!

Noury

-- 
------------------------------------------
Dr. Noury Bouraqadi - Enseignant/Chercheur
Ecole des Mines de Douai - Dept. G.I.P
http://csl.ensm-douai.fr/noury

European Smalltalk Users Group
http://www.esug.org

Squeak: an Open Source Smalltalk
http://www.squeak.org
------------------------------------------






More information about the Squeak-dev mailing list