Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!swrinde!gatech!usenet.eel.ufl.edu!spool.mu.edu!agate!news.ucdavis.edu!csus.edu!netcom.com!altinbay
From: altinbay@netcom.com (John Altinbay)
Subject: Re: Smalltalk formatting styles...
Message-ID: <altinbayD8BBnK.8sM@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <499293728@to.mobil.com> <3o9qq4$hc3@isnews.is.s.u-tokyo.ac.jp> <TXR.95May8022949@alumni.cco.caltech.edu>
Date: Tue, 9 May 1995 13:18:56 GMT
Lines: 38
Sender: altinbay@netcom20.netcom.com

In article <TXR.95May8022949@alumni.cco.caltech.edu> txr@alumni.cco.caltech.edu (Tim Rentsch) writes:
>
>	a > b  ifTrue: [			"first form"
>	    max := a.
>	] ifFalse: [
>	    max := b.
>	].
>
>than the "more natural" Smalltalk
>
>	a > b					"second form"
>	    ifTrue:  [ max := a ]
>	    ifFalse: [ max := b ].
>
>Besides being a more conventional expression of a control structure,
>there are good human factors arguments for using the first form given
>above.  Studies of error rates show that fewer errors are made with
>bracket alignment like the first form than the second form.  (Yes, I
>admit the studies were not done in Smalltalk.  I doubt the results
>would vary significantly if done in Smalltalk.)  So even though the
>final closing bracket stands out as somewhat ugly there on a line by
>itself, after one gets used to it, that ugly bracketing has a
>different kind of beauty that comes from writing code that is clear
>and error free.
>

OK.  Maybe I'm stupid or weird, but I look at the first form and
see only ugliness and stuff buried in each other.  Maybe someone
can explain to me why having the ifFalse: lie at the same level 
as the assignments and the brackets closing and opening where they
do makes the code readable.  To me, the flow is totally obscured.
To me, the second form is beautiful, and, more importantly, clear.

-- 
John Altinbay   -   altinbay@netcom.com   anon-1014@twwells.com
===============================================================
There's a spirit that guides me, a light that shines for me
My life is worth the living, I don't need to see the end.
