I was thrilled to learn today that my friend Eitan Suez has released his JMatter application development framework as open-source software.

I’ve been a huge fan of the idea of Naked Objects since I first saw Richard Pawson talk about the idea at OOPSLA in 2000. (He called the idea “expressive systems” then, but only the name has changed.) I introduced the idea to Dave Thomas at OOPSLA the following year, and he began spreading the word through a series of talks at NFJS symposiums.

Unfortunately, programmers who became interested in Naked Objects as an application-development strategy frequently turned away from it again after becoming frustrated with the poor quality and design of the default naked objects application framework. Eitan, however, took a better approach: he decided to write a better framework. And he wrote it in the context of a real application he was developing for his employer, which is always the best way to drive framework design: validating ideas in the crucible of real-world constraints. The resulting framework is JMatter, and it’s a great tool. If you’ve ever wanted to explore Naked Objects as a way of building cool, powerful business applications quicklyor if you’ve already tried Naked Objects but decided it wasn’t ready yetyou owe it to yourself to give it a try.

(Disclaimer: my enthusiasm for JMatter has nothing to do with the fact that my visage is prominently featured in one of Eitan’s sample application screenshots. Quite to the contrary, in fact. :-)

Buried Treasure

The NFJS 2006 Anthology is available for pre-order. The book is an excellent collection of articles by NFJS speakers, based in most cases on talks we’re giving during this year’s symposiums. Neal Ford did a great job as editor, and it’s being published (of course!) by the Pragmatic Bookshelf, which means you can get a paper copy, a PDF, or a combination.

My article is a bit unusual. Rather than expanding on one of my talks, I wrote instead about a common theme that characterizes many of my recent talks: old ideas or technologies that are showing their worth again in the modern software development climate, and the importance of knowing the history of our field. The article is called Buried Treasure, and I’m thrilled that it’s been selected as one of two articles that are available on the website as teasers for the book. I’ve love to hear your feedback!

Must Nip This in the Bud

Can’t Wait!

No Thanks, I’ll Stick With Ruby

Ted Neward writes about Microsoft’s Monad shell language, extolling its coolness … which is fine, except that he goes wildly wrong by titling his post “Need Ruby? Nahget Monad instead”.

Ted, my friend, thou doth protest too much, methinks. Pointing out cool technology is fine (and to some degree I agree that Monad is cool) but when you make a comparison like that, you have to back it up. And in this case, Monad falls woefully short, by your own criterion.

Here’s my Ruby version of your Monad “get-answer” script:

#!/usr/bin/env ruby

require 'open-uri'
require 'cgi'

fail "Please ask a question." unless ARGV.size > 0
question = ARGV.join(" ")
query = "{CGI::escape(question)}"
page = URI(query).read or fail "Couldn't get response."


if page =~ %r{<div id="results">(.+?)</div></div><h2>Results</h2>}
  response = $1
  response.gsub! %r{<\s*a.*?>.+?</a>}, "" # remove links
  response.gsub! %r{</(div|span)>}, "\n" # insert newlines
  response.gsub! %r{<.*?>}, "" # remove tags
  puts response.squeeze("\n").rstrip # collapse adjacent newlines and trim whitespace
  puts "No answer found."

Sorry, Ted, but I think that’s far better than the Monad version. And you do, too. Just a month ago, you wrote this:

While speaking at a conference in the .NET space […] Rocky Lhotka once offered an interesting benchmark for language productivity, a variation on the kLOC metric, what I would suggest is the “CLOC” idea: how many lines of code required to express a concept. (Or, since we could argue over formatting and style until the cows come home, how many keystrokes rather than lines of code.)

Leaving aside the fact that this is a very old idea, I agree that this is a mostly valid measure of language power and productivity (although I prefer to measure it in syntactic tokens, as Paul Graham does). And Ruby is clearly the winner.

Ruby: 17 lines, 76 tokens
Monad: 37 lines, 217 tokens

Plus, my Ruby version will work on my Mac, your Windows machine (even pre-Vista), Linux machines, my OpenBSD server, and those nice Ultra machines that Tim Bray is so kindly directing to worthy projects. So Ruby is more powerful in another dimension as well. (True, you would have to install Ruby separately on some of those systems. I’m so glad Apple doesn’t suffer from NIH syndrome as much as Microsoft does.)

Don’t get me wrongas a Windows shell language, and especially one built into Windows and supported by Microsoft, Monad is very cool, and a vast improvement on anything they’ve ever produced in that space. But it looks like Microsoft still missed some lessons, even in that restricted space.

There was a time when many serious systems were built as shell scripts, and even batch files. But in these days of serious scripting languages like Perl, Python, and Ruby, I can only think of one reason to write a substantial bulk of code in a shell scripting language like Monad, and that’s if you absolutely have to know that it will run without requiring a separate software installation. Shell languages have to walk this awkward line between terseness for convenient command-line use, and the constructs necessary for serious programming, and that makes them inherently awkward for the latter task. These days, shell languages are mostly useful for ad hoc on-the-command-line throwaway programs, and what I’ve seen of Monad tells me that it’s a little too strict and verbose for that job.

I do think Monad might have one seriously great effect: it might teach Windows developers the importance of designing utility programs with an eye toward cooperating with other programs in a scripting environment. But I don’t see it displacing Ruby, Python, or Perl anytime soon.

As for Ruby in particular, I think Edd Dumbill said it best:

… the subtle elegance of the Ruby idiom is a slowly appreciated and highly satisfying flavour.

subscribe via RSS