Eliminating assignments and variable syntax (accessors)

Doug Way dway at mat.net
Sat Aug 14 00:24:20 UTC 1999


I'm not so sure about removing block brackets either... sending messages
to blocks would get too ugly.

But I generally like the idea of enforcing an indentation style.  I
thought this was strange when I first saw it in Python, but it's pretty
nice.  The visual consistency makes code much more quickly readable.  (The
"freedom" to write code with any style of spacing/indentation is one of
the more overrated and uninteresting freedoms you could have.)

Probably the best way to get this visual consistency in Squeak is to just
turn on pretty printing.  It might be nice if browseWithPrettyPrint were
on by default, to give newbies a nudge in the right direction.  The only
problem would be getting everyone to agree on exactly what the best pretty
printing rules should be... I know I'd like to tweak a couple of the
current rules... :-) 

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com
  dway at eai.com, dway at mat.net


On Fri, 13 Aug 1999 agree at carltonfields.com wrote:

> > So it might be cool to be able to do something like this:
> > 	x < 3
> > 		ifTrue:
> > 			y := y + 1
> > 		ifFalse:
> > 			z := z + 1
> 
> This must be some new use of the word "cool."
> 
> >
> > But this doesn't look perfect, either--it takes 5 lines when 3 or
> > even 1 would do.  So, maybe allow the [ ] syntax for blocks that are
> > only one statement long? 
> >
> > 	x < 3
> > 		ifTrue: [ y := y + 1 ]
> > 		ifFalse:
> > 			z := z + 1.
> > 			m := m * m.
> 
> Let us remember that a fundamental difference between Smalltalk and
> Python is that Python's control structures are syntactic entities, while
> Smalltalk's are part of the messaging structure.  What we do for
> ifTrue:ifFalse: will apply equally for each and every other message
> schema. 
> 
> I frankly don't think that Guido's brilliant execution of
> indentation-as-syntax in Python, of which I am very, very fond,
> translates well to Smalltalk.  The angels-on-a-pinhead-counting
> agonizing over the virtues, meanings and utility of these examples, at
> least to me, proves the point. 
> 
> Why would we ever consider doing this to Smalltalk?  This is the
> question we must address as a threshold issue, before we start hacking
> out the implementation details.  Before we even consider what is "cool"
> and what is "neat," let's try first to agree on a more core issue of
> what bases, if any, we would use to choose one approach over another. 
> Until we can, this is all just religious banter.  What objective means
> would we use to decide whether a proposal is a good thing. 
> 
> 





More information about the Squeak-dev mailing list