A still sensible question about _ and :=

Joshua Channing Gargus schwa at cc.gatech.edu
Mon Apr 23 13:09:55 UTC 2001


On Mon, Apr 23, 2001 at 12:31:47AM -0700, Raab, Andreas wrote:
> Stef,
> 
> 
> >From somebody who's writing a lot of Squeak code:
> 
> > I'm really wondering why Squeak code continues to have _
> > instead of using :=.
> 
> It's just faster to type. That's all. 

It is also much prettier, IMHO.

> I used to do VW all the time and some
> of my older code uses := but once you get really into it it's just one
> character less to type. More efficient. Now I'm not saying it's good but I
> believe that is the reason - it's because those guys who are doing a lot of
> Squeak hacking have learned to value the increased efficiency. And nothing
> prevents you from writing := if you wish.
> 
> > I let the discussion of { . } for another email but I think from the
> > experience I had looking at ObjectStudio industrial application code
> > (ObjectStudio proposes also { } and programmer loved it to write
> > amazingly ugly code) that { . } is absolutely *not* a cool shortcut for 
> > dynamic array creation. 
> 

I don't mind it at all.  I also don't mind 2 at 3 instead of Point x: 2 y: 3.
For one thing, it doesn't need parentheses around it as an argument to a
keyword method.  I guess you could argue that it's a bit different than the
dynamic array creation since it stays within 'standard' Smalltalk syntax.
I still think that {1 2} is handy and clean-looking, though.

Joshua


> No?! Is 
> 	Array with: (Array with: 1 with: 2)
> 		with: (Array with: 3 with: 4).
> 
> any better than
> 
> 	{ {1. 2}. {3. 4} }
> ?! Just wondering...
> 
> Cheers,
>   - Andreas





More information about the Squeak-dev mailing list