initialize
is usually called by the new
method itself.
I believe the standard implementation is:
new
^self basicNew initialize
#basicNew
is a primitive that just creates the object, but does no initialization. All instance variables will be nil after basicNew.
Note that the initialize method isn't called automatically in all implementations of Smalltalk (but I don't know which ones don't do it) so if you want to be properly portable, you should override #new
in your classes to explicitly call it.