Looking for ugly code comparisons WAS: Slashdotter looking forkids' programming language
Bill Marriott
wjm at wjm.org
Fri Dec 12 14:29:42 EST 2008
Dave,
> [...] ugly code in RunRev is far far uglier than in any other language
> I've used for a number of reasons.
Quite honestly, I'd like to see examples and specifics to support this
claim. Indeed, if you think this is the case, try entering one of the "code
obfuscation" challenges. It's quite rare I get a block of Rev code that I
cannot understand with a little bit of study. The same cannot be said for
other languages. At worst there might be a "PageMaker" effect. For those of
you around at the dawn of desktop publishing, the availability of this
software (and LaserWriters) to the masses led to a lot of poorly designed
newsletters. But just as with PageMaker, Revolution enables mortal beings to
accomplish things they could not consider doing previously. The particular
expression may be inelegant, but if it works, it works.
> It's seem like clutching at straws and verging on being deceitful to make
> RunRev look good by showing how bad other languages can be, while at the
> same time keeping quiet about how ugly RunRev code can be!
Them's is strong words, fightin' words!
Look, someone can write a pretty awful novel in English. But you can at
least read it, even with horrendous spelling and grammar errors, etc. You
could be given a brilliant text written in Chinese, but if you don't know
Chinese, it's a bit moot.
The readability of our language is its primary selling point, and not just
something RunRev made up as a slogan over pints. It's why Revolution exists,
the primary reason why we all use it. Not out of necessity, not because
we're less intelligent, but because it's a joy to write and efficient to
maintain. I'd venture many of us wouldn't be programmers today if it weren't
for Rev.
While the majority of Slashdotters in that thread are debating the relative
merits of one language over another, the elephant in the room is that they
are ALL by comparison to Revolution, UNNATURAL. ONLY Revolution* comes close
to using plain English to describe an algorithm. It might even be valid to
say that because Revolution does not have built-in routines for some of the
things other languages can do that you must add custom functions or work
around those limitations in an inelegant way. But, you can STILL read and
understand what that code does! Even Brian Yennie's fanciful example of
"ugly" Rev code was merely complex (you might not off the top of your head
predict the result), but each line was clear what it does.
I do not feel there is any reasonable debate that the average Revolution
handler will be shorter, clearer, and easier to follow than the average
routine in just about any other language. Revolution is the pinnacle of
"self-documenting" code available today. If you want to show evidence that's
not the case, I'm all ears.
At the end of the day I suppose it might come down to aesthetics, which is
difficult to quantify in a way where we can say, "Yes, this is more ugly
than that." But there are no straws to be clutched at here. Of all the
criticisms that could be made of Revolution, inscrutable code is not one of
them.
- Bill
* and HyperCard, SuperCard, and Director Lingo, all deprecated products
(Director shifted to ECMAscript), and AppleScript (which as demonstrated
elsewhere in the thread has evolved toward unreadability)
More information about the use-livecode
mailing list