Categories

More Monkey Business

Originally posted on another one of my blogs in ‘08, this is a follow-up to
Monkey See, Monkey Do, an experiment in computer language lucidity which looked at
implementations of the eponymous program in English, Groovy, Perl and Java.

I have received some contributed monkeys: today we’ll look at Ruby Monkey and Python Monkey.

Ruby Monkey

Ruby monkey quite arguably ought to have been included in the first troop of monkeys. “Ruby”
is the word most likely to follow the word “like” when Groovy programmers are talking about
Groovy to programmers who have never heard of Groovy. Ruby is Payton Manning to Groovy’s
Eli. So without further ado, here is the Ruby Monkey contributed by Jason Felice:

This monkey is quite similar to the Groovy Monkey, but of course there are some differences.
Let’s anglicize this gem of a primate:

Monkey is monkey new.
Monkey see each action, monkey do action.

I’ll admit I may have taken a little poetic license with the placement of the comma in the
second line, but I think it was worth it. This is eminently comprehensible as English.
In fact I’d have to say this monkey edges past the Groovy monkey and vies with
the Perl monkey for the title of Most Lucid Monkey.

Ruby Monkey Guts

Jason’s implementation of this monkey is very similar to the Groovy and Perl monkeys:

Python Monkey

Bob informs me that “monkey” is one of his favorite variable names. He uses “monkey”
when other programmers cling stubbornly to “foo.” He also apparently prefers his
monkeys to have names. So let’s see how Lulubelle sounds in English:

Monkey is monkey Lulubelle.
Monkey do action for action in monkey see.

Wow! That’s a totally different grammatical formulation! It almost sounds something
like “Monkey does what monkey sees.” Obviously, Lulu marches to the beat of a
different drum, preferring not to ape her counterparts from other languages.

This Python Monkey seems pretty verbose. This is partly because she has distinct
methods for each of the things that the Monkey can see. But notice the difference
this makes possible: other monkeys are technically seeing strings which represent
actions. It’s almost more like “monkey read, monkey do.” But this Python Monkey
sees methods; so Lulubelle is literally “seeing” the action which she then does
herself.

Python monkeys obviously have a unique take on solving problems. Some say they
can’t adhere to a spec. But Python Monkeys generally have a clear objective in
mind, and they end up with some very interesting results.

What does a monkey look like in your native tongue? I have a friend pondering
what a Haskell monkey would look like. But I’d also really love to see your ideas
for others; what would a functional monkey look like? Clojure Monkey? Arc Monkey?
Erlangutan? Or how about a Basic Monkey? Is that even a meaningful concept?

In any case if you have an example of a monkey in any other idiom, please put
it (or its URL) into a comment below; I’d love to include it and
compare it to the above examples.

Some great estates provide, but do not breed
A mast'ring mind; so both are lost thereby:
Or else they breed them tender, make them need
All that they leave: this is flat poverty.
For he, that needs five thousand pound to live,
Is full as poor as he, that needs but five.