[Newbies] Should all methods return a value?

Charles D Hixson charleshixsn at earthlink.net
Tue May 9 05:16:29 UTC 2006


I know that in some languages this matters, and in others it doesn't. 
E.g., in C if you return a value, the temporary must always be stored
when the function is called, but in other languages it can be ignored,
and in some languages if you don't intentionally return a value, the
system will automatically create a value (usually nil) to return for you.

Eiffel make a big deal about separating Commands from Queries, with very
strict rules about which kinds of routines can do what kind of things. 

Presumably Squeak (and Smalltalk) is flexible here...but I haven't seen
it documented anywhere.  (Also, can anyone recommend a good tutorial
that isn't graphics based?  What I want to do right now is really more
text oriented.)  I got the two Mark Guzdial books, but that doesn't
really cover much in any depth. 




More information about the Beginners mailing list