Newbie q

Phil Hudson phil.hudson at iname.com
Fri Sep 26 05:09:51 UTC 2003


>Welcome to Squeak Phil!

Thank you. I'm hooked already.

>If you mean the class definition when you say "declaration," the answer is
>no.  Usually one puts the initialization of a variable to some default
>value in the #initialize instance method.

Hmm. This prevents us from following a widely-accepted "best practice" in
programming: always initialize every variable as soon as it comes into
scope. Isn't this a Really Really Bad Thing?

Put another way: wouldn't Smalltalk gain something useful, and lose
nothing at all, by enabling initialization of each variable at the point
where it is declared (or named, or introduced, or whatever is correct in
Smalltalk)?

>On Thu, 25 Sep 2003, Phil Hudson wrote:
>
>> Am I right in thinking that you can't initialize a local variable (or
>> indeed an instance or class variable) in its declaration?




More information about the Squeak-dev mailing list