Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!europa.chnt.gtegsc.com!library.ucla.edu!info.ucla.edu!csulb.edu!csus.edu!netcom.com!altinbay
From: altinbay@netcom.com (John Altinbay)
Subject: Re: Smalltalk formatting styles...
Message-ID: <altinbayD8F2K4.80s@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <TXR.95May8022949@alumni.cco.caltech.edu> <altinbayD8BBnK.8sM@netcom.com> <TXR.95May9175641@alumni.cco.caltech.edu>
Date: Thu, 11 May 1995 13:52:51 GMT
Lines: 64
Sender: altinbay@netcom16.netcom.com

In article <TXR.95May9175641@alumni.cco.caltech.edu> txr@alumni.cco.caltech.edu (Tim Rentsch) writes:
>Replying to:
>
>>  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.
>
>One of the important, fundamental distinctions made in Computer
>Science is evaluating a code fragment to compute a value (functional)
>and executing a code fragment to cause an effect (imperative).  Things
>that have an effect should stand out, one after another, because it is
>the sequence of effects that make the block of code do what it does.
>To say this another way, snippets of code that have side effects
>should be on a line all by themselves.  Conversely, snippets of
>code that compute values (without side effects) are reasonable
>to use as subexpressions of larger snippets.
>
>When I read a program (yes, even a Smalltalk program), I don't want to
>have to work to find the executional units.  I want to read one line
>of code to see what it does, and then go on to the next one.  My eyes
>don't work the way a parser does;  I use spatial organization rather
>than scanning of input streams.  I devote a significant amount of
>effort to each imperative unit (usually statement);  my attention
>should be focused, neither distracted by surrounding text nor diluted
>by having to spend effort on finding the boundaries.  >>>The important
>boundaries here are those of sequential imperative execution;  my rule
>is that the imperative executional boundaries must be marked by some
>vertical separation.<<<
>
>To get back to the article excerpt given above -- the position is
>clearly stated, however I still don't know why the position is taken.
>What are the characteristics that are important?  What are we hoping
>to accomplish with one stylistic form or another?  The answers to
>these questions should illuminate some differences in our opinions.
>

I understand your point.  I just don't understand how it translates to
the code examples, which were something like

aBoolean ifTrue: [
  someStatement
]  ifFalse: [
  someOtherStatement
]

vs.

aBoolean ifTrue: [ someStatement ]
         ifFalse: [ someOtherStatement ]

To my eye, the latter makes the components stand out, while everything
 is buried in the second.  Sure,
the statements are on their own individual lines, but they don't stand
out.  They're buried.  You have to look closely to see them.  *That's*
my point.  Am I weird?

-- 
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.
