fixing undescores

Hans-Martin Mosner hmm at heeg.de
Tue Oct 18 18:29:32 UTC 2005


Fournier Eric wrote:

> Observations on the assignment operator thread:
>
> Choosing an orthographic representation for a language based on  
> terseness or easiness to type it in leads to ... Perl (widely held as  
> a 'write-only' ie unreadable language). The characters will be read  
> (by a human) many more times than typed. Choose readable clarity over  
> typing convenience.

This is a very good argument. Whether someone considers := a well 
readable assignment symbol is a matter of taste, but at least it's 
clearly distinguishable from any allowable binary operator.

>
> Anytime you leave basic ASCII you limit your portability. Wasting  
> time converting characters is ... wasting time. There _are_ good  
> reasons for internal representations to be more complex. We don't  
> have them here. Design as simply as possible.

Yup.

>
> We should think about adoption (not among us--among them). ':=' is  
> widely recognized as an assignment. Lower the entry threshold for  
> adoption by the world where possible.

I do not care very much about entry threshold here (there are other 
factors much more important than the use of assignment symbol). But it 
certainly make Smalltal code *somewhat* easier to read for non-Smalltalkers.

>
> The same argument holds for using the up-arrow '^' replacement for  
> return. '^ foo' should be 'return foo' IMO because it reads  
> unambiguously. Typing convenience can be accomplished using keyboard  
> macro widgets (QuicKeys comes to mind).

This is where I disagree. Introducing a reserved word is a bad idea. 
Method return is a special operation, it warrants a special symbol. 
Words in Smalltalk are invariably used to denote either variables 
(including pseudo-variables such as true, false, nil, self, super and 
thisContext) or messages, depending on their syntactic position. 
Introducing a 'return' keyword would break that rule. Remember, design 
as simply as possible :-) The simplicity of the language's syntax is one 
of Smalltalk's strengths.
Cheers,
Hans-Martin




More information about the Squeak-dev mailing list