Fear and loathing of the "perlification" of Smalltalk

Jason Johnson jason.johnson.081 at gmail.com
Thu Sep 6 19:42:54 UTC 2007


On 9/6/07, nicolas cellier <ncellier at ifrance.com> wrote:
>
> However, polymorphism is a mean to achieve some of contextual features
> of our spoken languages. Verbs (messages) can be understood differently
> according to the context (the class of the message receiver).

Yes, I thought about sending this in a follow up, but since you bring it up:

We don't use context in spoken language because we wish to be
misunderstood, but rather because it takes too long to make everything
explicit over and over.  And, yes, this applies to programming
languages as well.  But how do we manage context in programming?

In Haskell the focus is on "purity" and therefor the code that has
"side effects" is very loudly and clearly demarcated from the code
that doesn't.  Likewise, OO very clearly separates contextual
concerns.

In Smalltalk the language is regular in every case.  You manage
context by supplying the object that has the context you need at this
time.  The person reading your method sees you take a collection and
add elements to it.  Knowing what the type of the collection (i.e. the
context) is is not important to know what the method does.

Contrast this with languages that make heavy use of context; when you
read a statement you can't be sure what it does because the semantics
of the language may change depending on what got passed in, what the
receiver of the result expects (!!) and even settings in effect when
the method was called.  Couple this with the OO way of handing context
as well and the complexity starts to be untenable.

> If you think of it, Smalltalk is maybe the programming language closer
> to our mother one.

No, because in Smalltalk this incredibly complex thing called context
is demarcated away from the very simple rest of the language.  Spoken
language is vastly more complicated.  You have indirect pronouns,
contractions, unpredictable verb tenses and the grammar rules may
change based on the presence of certain words.

> Have you ever used the Debugger to disambiguate some code sometimes?

In Smalltalk?  No, honestly I don't believe I have since I learned the
syntax.  It's so simple I can't think of anything that's ambiguous.
If the formatting is pour I might have to reformat, but that's it.



More information about the Squeak-dev mailing list