[Tfug] Language choices

Tim Ottinger tottinge at gmail.com
Tue Nov 7 12:52:09 MST 2006


I think you're right about less syntax being better, and less
nonpronounceable syntax being better yet.  Of course, there is tradeoff,
yes?  What if having a single, consistent syntax "trick" (as all punctuation
in programming is a trick) meant that you could have a fraction of the
syntax overall (pronounceable and not)?

This is the thing about
    x<1 IfTrue: [ do something ]
          ifFalse: [do something ]
that I find appealing.  You don't have to add "if..else..then..elseif" to
your syntax. The only syntax we have here is:
    object message
    object message: parameter
Or more complex:
    20 To: 50 Step: 5 [ doSomething ]
Is actually a method on the integer class called To:Step: that takes a "to"
parameter, a "step" parameter, and a "callable"

this looks funny the first time you see it, but not nearly as weird as "DIM
A as CHAR[100]", or "for(int i = 10; i<50; i++)"

The idea that everything (expressions and variables) are all objects, and
all programming is sending messages with objects parameters is very simple,
and far-reaching in power.

This is what I like about smalltalk and ruby, and to a lesser degree python
(though I use python more?).  It's also what I don't like about C++, Java,
and C#.   In particular, I think that the way Java added "synchronized" as a
special keyword in the language instead of a general mechanism for wrapping
blocks or closures is sick and wrong.

Of course, a few years ago I wouldn't know any better. :-/

Tks for an interesting discussion.



More information about the tfug mailing list