Most People Don't Like Working Without a Net

Posted by Rick DeNatale Wed, 18 Jul 2007 01:51:00 GMT

Good article about a basic principle of UI goodness by Jef Raskin’s son Aza.


Have you ever had that sinking feeling when you realize—just a split second too late—that you shouldn’t have clicked “Okay” in the “Are you sure you want to quit?” dialog?


Where I Come From

Posted by Rick DeNatale Thu, 21 Jun 2007 19:06:00 GMT

Maybe I’ve gotten a bit sensitive of late to the perception some Rubyists
seem to have of Smalltalk-bred Rubyists like me. So I thought that I might say a bit more of what
I think of the current and future of Ruby as a language.
What follows is much longer than what I expected it to be when I started writing it yesterday,
I hope that some will find it some combination of interesting, useful, thought-provoking, or
at least amusing.

  • This weeks meeting of the raleigh.rb
    group was a recap of railsconf 2007. Some of the attendees seemed to have gotten
    a feeling that Avi Bryant was attacking Ruby in his keynote. I can’t speak for
    him, and I wasn’t there so this might just be my reaction.
  • Heard this week on ruby-talk in a discussion of the fact that Module#ancestors doesn’t
    include a singleton class of the receiver should it have one:

    I do not want to argue with the wise guys if it is an error – I
    clearly thought so but that is not important ;)


    But it really would have saved me an hour of debugging if the doc
    stated clearly that singletons are not included. I thought this might
    help others and as it took me 20s to vim the missing line into class.c


    - Robert Dober

    To which I replied:


    As far as I can tell, singleton classes aren’t mentioned in the doc.
    The documentation borders on folklore.


    Singletons as a means of implementing both individual instance, and
    class behavior have a position like “the man behind the curtain” in
    “The Wizard of OZ.” We’re really supposed to disregard them.


    Coming from a background in Smalltalk, my preference would be if this
    machinery were more visible and official, but Matz has his reasons for
    not doing so. For one thing, not documenting it, and hiding it from
    methods like ancestors and class makes it easier to tinker with as the
    language evolves without “officially” breaking backward compatibility.

    Which prompted:


    Does that mean that no one who’s ever used Smalltalk can ever think
    that it’s right for Ruby to deviate from Smalltalk? :-) I ask in a
    humorous spirit – and also because it gives me an excuse to mention:


    http://www.infoq.com/articles/coming-from-ruby


    — David A. Black

To answer David’s humorously posed question, No,
and I present myself as “exhibit A,” because I certainly think that it’s right
for Ruby to deviate from Smalltalk. My main motivations in writing about Ruby in the context
of my Smalltalk background are first to help myself, and I hope others, understand Ruby a little
better by providing some perspective from another, earlier, dynamic language, and second, to a much
lesser extent, to air ideas of how some of the features of Smalltalk might be incorporated or
adapted as useful additions to Ruby as it evolves.

In many ways, I like Ruby better than I like Smalltalk. To name a few reasons, Ruby is more dynamic, has a more flexible deployment ‘model,’, and
albeit it’s not a technical reason, it’s not carrying the burden of the old business model of
trying to get thousands of bucks for each development seat.


This
is what really allowed
Java to pop Smalltalk’s balloon. Smalltalk was seen by IBM and it’s competitors as “enterprise”
technology, and they expected the same kind of prices which
other corporate level software development
tools commanded. When Java came out and was free “as in beer,” it gained a large popularity with
language hobbyists/hackers who could easily get it to play with, and a lot of those guys worked
for the companies to which IBM, ParcPlace-Digitalk, and the others were catering.

The other aspect of Java which helped at the time was it’s relationship in
syntax, and a lot of its semantics, to C++ at a time when there was a lot of corporate C++
activity and some frustration was starting to be felt with the complexity of C++. Java
felt enough like a simplified and friendlier C++ being a language which was more dynamic
without “going all the way” and which
felt familiar to both C++ advocates and C++ approach to
strongly typed class hierarchies, and C++ programmers with symptoms of the
Stockholm syndrome.
These self-same aspects of Java caused many Smalltalkers to be uneasy with
the language.

The real salvation of Smalltalk, as it exists today, was and is Squeak. I remember when I
first encountered Squeak, it was at a Birds-of-a-feather session at OOPSLA, right when Java was
really starting to get most of the mind-share. My impression was that the atmosphere in the room
must have been somewhat like that in the Roman catacombs when the early Christians were
hiding out.

I guess that there is still a bit of the old “Enterprise” Smalltalk market,
Instantiations, which took
over the old IBM/VisualAge Smalltalk base when it fell out of IBMs strategies,

sells it for an entry price of
$6,995.
There must be enough of the old legacy corporate Smalltalk customers around who
buy it.

Personally, it’s been quite a while since I was an active Smalltalker, I made an oddyssey
through Java-land with IBMs shift in priorities. I plan to write about some of my
feelings during that period in retrospection but that’s for a later date.

I haven’t been
keeping up with Squeak enough to know how and how much it has evolved the Smalltalk technology
and community.

Old Smalltalker’s perceptions of Ruby

I always thought that Smalltalk would beat Java, I just didn’t know that it would be called
‘Ruby’ when it did.

— Kent Beck

I ran across this quote for the first time a few weeks ago. It sounded like
something that Kent would say, and also something that I would like to quote myself, but just
to make sure, I asked him. He told me that ‘yes’ he had said it in a private communication to
someone else, and both he and the original recipient had only recently found out that it was
becoming an internet meme. Googling <a href=""I always thought smalltalk would beat java">
“I always thought that Smalltalk would beat Java” garners over 250 hits.

Kent tells me that he’s a Ruby fan. Ward Cunningham is also.

I asked Ward, just before RailsConf,
if he was going since it was in his home-town.
He said that he had found out about it after
registration was closed, but he was planning to hang out at the hotel anyway. From what I heard
last night he was recognized and invited to attend.


Several of my other old Smalltalk buddies, who had also gone through a period with Java,
seem to have the same feeling which I do, that
looking at and using Ruby feels like being a widower who meets a new woman, who just seems to
be a partial reincarnation of the former spouse.

Where You Are Come From Depends On Where You Came From

Getting to David Black’s article. He certainly has a point about letting Ruby be Ruby. As
I’ve said, I’m quite happy with Ruby.

Getting back to the early perceptions of Java, and making an analogy with natural languages
let me suggest that if we think of Smalltalk as Italian, and C++ as German, Java is
Alsatian, and Ruby is French.

Were it not for Squeak, Smalltalk might be Latin instead of Italian.

The most un-Smalltalk like thing about Ruby, to me at least, is the syntax,
Smalltalk has almost
none, many Smalltalkers say that Ruby has too much. I thought so initially, but now
I’d argue that the flexibility and
“sugarary” aspects of Rubys syntax are what makes it so successful as a host for internal DSLs
like Rake, Rails/ActiveRecord, RSpec, etc. etc. which would be far less
natural in Smalltalk with its extremely limited syntax.

One of the complaints I often
heard about Smalltalk was it’s ‘different’ syntax just unary, binary, and keyword message send
expressions, blocks, parentheses for expression grouping, the use of ‘;’ to send a message
to the object which got the last one,
and single value assignment, and a way to return a value, everything else,
including class and method definition, and control flow was built from these atoms.

Ruby probably appeals to a broader audience
since it looks enough like something like Java not to be considered too wierd, at least not at
first. For one thing in ruby 1 + 2 * 3 is 7, instead of 9 in Smalltalk due to its total lack
of operator precedence.


But, syntax differences aside, conceptually both Smalltalk and
Ruby are romance languages, as compared to the Teutonic C++ and it’s kinder-gentler relative.


Language Evolution and Cross-Breeding


Programming languages evolve much like natural languages. They pick up influences from
other languages and incorporate them with modifications. English is the equivalent
of a multi-paradigm language, it has been influenced by the languages spoken by both the conquered
and counquerors of English speaking lands. It’s been influenced by Vikings, Normans, and Indians (both the Asian and American meanings of the last).
English has a lot of synonym pairs one from French and
one from Anglo-Saxon with it’s Germanic roots. Pork and pig; beef and cow; fraternity and brotherhood. This comes from the days after the Norman conquest when the language of the English court
was French. Bill Bryson describes this in his book
The Mother Tongue""The Mother Tongue".



Many of the words considered “fancy” by English speakers are of French origin. Kent
Beck told me that while he was working in Zurich on a contract with a Swiss bank, he found that
an effective way of communicating with the programmers there, was to use simple English grammar,
but “fancy” English vocabulary. The latter helped because the Swiss programmers facility with
French increased the chances that they would share such word.


Multi-lingualism


There’s an old joke which goes:


What do you call a person who speaks two languages?

Bilingual.

And what do you call someone who speaks only one language?

An American.

Most good programmers, even the Americans, are multi-lingual when it comes to programming
languages. As it does with natural languages, this gives a broader perspective.

But multi-lingualism sometimes makes it hard to compartmentalize language concepts.
Once on a trip to Zurich,
I was having dinner with Erich Gamma, some other Zurich OTIers, and a couple of customers in a
very nice restaurant on the Bahnhofstrasse. My facility with German fills a small thimble,
but as I perused the large menu, with no obvious English to be seen, I realised that I was reading
it rather easily, and thought to myself, “Hmmm, I’m starting to understand German.” Then I
realized
that the menu was in fact bi-lingual, but the second language was French, a language with which I do have some facility.

I suspect that the “coming from x” quotes in David Black’s article are the result of this
difficulty in compartmentalizing by newcomers to Ruby.

A Living Language

Programming languages, like natural languages, survive best when they evolve, this is what
distinguishes live languages from dead ones. Languages die as the number of speakers diminish,
despite revival attempts like Winnie Ille Pu,
Quomodo Invidiosulus Nomine Grinchus Christi Natalem Abrogaverit: How the Grinch Stole Christmas in Latin,
Harrius Potter et Philosophi Lapis (Harry Potter and the Philosopher’s Stone, Latin Edition), or
the Vicipaedia.

Ruby is evolving, the core-team isn’t asleep, right now ruby1.9 is the cauldron to which new
potions are being added to brew what will emerge as the next major Ruby revision.


This is another area where Ruby and Smalltalk have similarities.
Smalltalk started as a paper design by Alan Kay to win
a hallway bet challenging his assertion that he
“could define the ‘most powerful language in the world’ in ‘a page of code’.”
Dan Ingalls then actually implemented it in Basic on a NOVA minicomputer, this
begat Smalltalk-72,
which begat Smalltalk-76, which begat Smalltalk-80. Smalltalk-80 was the basis for the
commercial Smalltalks of the pre-Java era, VisualWorks Smalltalk (ParcPlaces commercial Smalltalk-80),
Smalltalk/V which merged with VisualWorks when ParcPlace and Digitalk merged, and IBM/VisualAge
Smalltalk. Squeak is also a child of Smalltalk-80.


Smalltalk started to freeze when it became commercial. We tried hard to forge a standard in
X3J20 which allowed evolution and variation by underspecifying things as much as we could, but
broad enterprise acceptance slowed things down quite a bit.


So it’s exciting to see that Ruby is evolving. I hope that it too doesn’t get bogged down
in it’s success.


Personal Preferences


Finally getting back to my “Coming from Smalltalk” quote in ruby-talk, I expressed a personal
viewpoint that Ruby would be well-served if the mechanisms of singleton classes, and their use
as metaclasses were made visible and officially documented parts of the language.
If the rationale for not doing so is to preserve “freedom-of-action” in changing the
implementation in future versions, I can understand it, but to used a mixed language
expression, that is a “two-edged katana.” One of the things which Alan Kay told me a long time
ago was that he was disappointed that so few Smalltalkers experimented with changing and
extending Smalltalk by building off of the mechanisms of Class, Metaclass, and Behavior.
In Ruby, despite the fact that knowledge of the equivalent implementation is only known
“sub-rosa,” there is much more such experimentation.
Metaprogramming in Ruby is au courant, and lots of code is being written which depends on
undocumented “stuff.” I have to ask if this, being undocumented that is, is a good thing.


So, to wrap this all up, while I do “come from Smalltalk,” Today, I live in Ruby!


Sapir-Whorf

Posted by Rick DeNatale Mon, 11 Jun 2007 20:32:00 GMT

Recently, I’ve seen the Sapir-Whorf hypothesis used to motivate new spins on old ideas, such as behavior-driven design. For those unfamiliar with Sapir-Whorf it comes from the school of linquistic determnation, and taken to the extreme posits that a person’s language determines the way he or she thinks.

I’m going to post some thoughts about bdd soon, but this appeal to Saphir-Whorf reminds me of an experience I had about 10 years ago.

At the time, I was on a tour of eastern Europe for IBM. Our team was giving presentations on IBM software development products to developers in the former Soviet Bloc. I found myself in a hotel bar in Budapest with Muriel, a lovely young Frenchwoman who I’d met some months before and who was also one of the speakers. I’d decided to try to recover my old high school French which had been “rusting” for about 20 years. We had had several discussions about the French language and how it related to English. She had done a couple of overseas assignments with IBM in the US previously, and had worked in Connecticut with someone who had grown up in Brooklyn, which resulted in an amazingly charming and unique accent when she spoke English. We remain good friends to this day.

After a short time we were joined by another IBMer who was an American on assignment in Paris.

Flashback

I’d met him earlier in the day, when we were preparing for the next days session with the help of sevaral local IBMers. He had needed help in editing his Freelance presentation (I guess his secretary normally did this for him), and Muriel had done it using a Thinkpad borrowed from one of the Hungarians.

After she had finished, she closed Freelance to reveal that the machine was also running Microsoft Word. Mr. American in Paris went ballistic, since IBM had recently acquired Lotus. He couldn’t understand this treason, why was the guy not using Ami Pro? The answer was that Ami Pro didn’t yet support the Hungarian language.

This wasn’t enough to satisfy our friend, and the Hungarian went away shaking his head.

Back to the Bar

So our friend showed up and told us that, although he’d been in Paris for nearly two years, he hadn’t bothered to even try to learn any French. His theory was that there was no need since “everyone you work with speaks English anyway.” Now he exposed himself as a lingustic determinist, “and people who speak languages other than English can’t form certain thoughts.”

Oh really!? I said, like what?
“For instance, there’s no way to say “I like you in French.”

I shot an amused look at Muriel, we’d been talking about that very thing in the recent past. Those with a surface “knowledge” of French think this because the verb “Aimer” means both “to like” and “to love.” If you want sweet-talk a girl you say “Je t’aime.” Which every high-school French student, and ever sailor on shore-leave in a French-speaking port knows means, “I love you.” So they figure that there’s no way to say “I like you” since “aimer” is already taken.

But of course there is. French isn’t the “language of diplomacy” due to a lack of expressiveness. One way to say I like you is “Je t’aime bien” which seems odd to some since the “bien” strengthens a verb. That girl you’re trying to sweet-talk migh reply with “Je t’aime bien, mais je ne t’aime.” or “I like you but I don’t love you.”

And the Japanese don’t have a word for “no” which is why they can’t be impolite.

Again, this is patently false. Anyone who watched the old mini-series whould now that one of the first words Anjin-san learned was ie which means an emphatic no. The Japanese have lots of ways of saying no, or expressing variations of that thought, with various levels of politeness.

He went on to express several similar thoughts, but my amazement at his naiveté soon turned to boredom, and I tuned him out.

Does Language (Determine|Influence) Thought?

The Sapir-Worf hypothesis in it’s strongest form, and more generally, linguistic determinism, are nothing if not controversial amoung psycho-linguists. While there is some experimental evidence that language might have some influence on thinking, it doesn’t seem to be as pervasive as Sapir-Worf would predict.

Language, Expression, and Communication

It does seem evident to me that language affects the way thoughts are expressed, and that this difference in expression can hinder communication.

Take the expression of “I like you” in French. Not understanding the subtleties of expression might lead to a slapped face! I’m not sure about this, but my theory about “Je t’aime” vs. “Je t’aime bien” is that the two phrases might be related to teachings in the Catholic church. When I learned of the distinction, it brought back a memory from parochial school. The parish priest was visiting the classroom, and the teacher, a nun, asked him to explain the difference between “like” and “love.” He said that like was more than love because “I have to love you, but I don’t have to like you.” Because we might be talking to someone whose native language lacks the subjunctive case doesn’t mean that she can’t think hypothetically, and when she is trying to talk hypothetically we might not understand how she translates from her native language into English. It actually disproves my “ugly American friend’s” belief that since everyone needed to do business with already speaks English, there’s no need to make any effort to understand their language.

Now Back to our Regularly Scheduled Program

So what does all this have to dowith the usual subject matter of this blog?

The answer is that this mismatch between thought and expression leads to misunderstanding even in technical matters.

Someone whose ‘native language’ is strongly typed can have a hard time understanding the expressive power and idioms of a dynamically typed language such as Ruby or Smalltalk, and those without knowledge of Java or C++ can have a hard time understanding those guys, and arguments can proliferate because words denote slightly different concepts in various programming languages.

Different “methodologies” can sprout up as different groups of developers independently discover the same or similar techniques and give different names to the same concept, or the same name to different concepts, or a guru decides that a vocabulary shift is just the thing needed to explain something to a group with another mode of expression. Some of have been using agile techniques before they were agile, or even extreme.

And it can be languages vs. methodologies. I like to use the term “behavior” the way Smalltalk uses it, as an abstraction for an object which contains the methods of other objects (i.e. classes and metaclasses). I’m afraid that with the rising popularity of behavior-driven development in the Ruby community, with a different meaning of behavior, I’m going to have to find a new term.

But more on BDD here soon.