Perhaps naive question about the colon.
blake at kingdomrpg.com
Thu Dec 2 12:48:33 UTC 2004
On Thu, 2 Dec 2004 12:42:07 -0000, Frank Shearar
<Frank.Shearar at rnid.org.uk> wrote:
> You mean something like
> light: fire
> with: flintAndTinder
> usingForFuel: twigsAndStraw
> I don't know when it was invented, but Kent Beck's (fantastic!)
> "Smalltalk Best Practice Pattern" describes it in the Indented Control
> Flow pattern on page 175.
I'll have to check that out.
> I've always figured it as analogous to doing this in Delphi:
> at least where indenting's concerned.
Except, in Delphi, I'd do it this way:
Caveman.Light(Fire, FlintAndTInder, TwigsAndStraw);
I think it's less necessary in Smalltalk, but in more conventional
(common?) languages, I favor conservation of vertical space. I believe
(and I think studies have backed this up) that if I can see the entire
method all at once, I can grasp it much more quickly.
It's one of those things that commends Smalltalk to me, I think, since
most methods are relatively short. So much so that you don't need to
conserve vertical space.
More information about the Squeak-dev