Where would you put the return?

Andreas Raab andreas.raab at gmx.de
Mon May 19 21:06:27 UTC 2003


> > Or, perhaps it's just that I think a method with no explicit 
> > return statement should return nil instead of self (and _that_
> > I think very strongly!).
> 
> Interesting.  So why do methods answer self by default?

Beats me. But if I see that a method has no return statement then I think
that 'this method returns nothing'. And 'nothing' is nil - the undefined
object. Besides, returning self by default is a horrible mess when you think
about security as you are constantly leaking authority.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list