Wrong Turn

(I apologize for the length of this one … but it’s a big topic.)

Mike Clark wonders where we went wrong with J2EE.

There are many answers to that question. The glib one is “J2EE is the wrong platform for a Hello World application.” A slightly more serious answer is that the architecture of the web is to blame. There is a lot of truth in both answers, but they miss the point. Hello World is just the extreme case of the broader problem that J2EE applications are much more complex than they have to be. Dave Thomas’ question about Hello World is just Dave’s way of getting us to consider why that is. As it happens, I’ve been thinking about the same problem a lot over the past few weeks.

I recently had lunch with a friend who has been away from coding for a couple of years (and before that he didn’t really do any J2EE work). He was in the middle of trying to explore two thingsblogging and J2EEby installing and investigating Roller. He got it installed and was using it for a blog, but he was very frustrated by trying to understand it. He’s no slouch when it comes to reading code; in fact, he has a reputation for being extremely good at picking up large systems and quickly understanding them well enough to make urgent changes. But Roller struck him as needlessly complex, with the sheer number of different frameworks, config files of different types, internal interfaces, etc. He did not have the impression that it was a Roller problem; he had come to the conclusion that this is just the state of J2EE. And whether Roller is a particularly good or bad example (I know hardly anything about it), my friend was definitely right about the state of J2EE.

He asked me the same question: “What went wrong?”

About ten years ago I read Bjarne Stroustrup’s The Design and Evolution of C++. It’s a wonderful book that I highly recommend. Stroustrup explains how C++ came to be how it is (or was, at that time), including rejected ideas, rationales, goals and priorities, etc.

The fascinating and troubling thing about it is that Stroustrup began with a language I likeCand made a series of very sensible design decisions, ending up with C++ (a language I don’t like). I found myself asking the same question as I finished that book. What went wrong?

Any answer to that question is bound to be too simplistic, but I think it’s not far from the truth that the misstep in the case of C++ was the very first one: deciding to implement a strongly typed OO system atop fast-and-loose C.

Looking at J2EE today, I find myself thinking similar thoughts. Of course, not all of the decisions were nearly so reasonable as Stroustrup’s C++ decisions (I have some friends who were involved in the original design of J2EE, and there were some very unpleasant political and marketing forces involved). But even if they had been, I fear the result would have been much the same.

Here’s what I think the problem is: we started with a language that is insufficiently reflective (so that it can only be extended in limited ways from inside) and that has too much syntax (making it difficult to adapt to more declarative tasks). So we have containers, code generators, interface generators, EJB compilers, and bytecode enhancers, XML config files running out the ears, and on and on.

It doesn’t have to be that way. Try building web apps in Ruby, using Borges. Or Smalltalk, using Seaside2 or Comanche. Or in Common Lisp, using KPAX or WebActions.

(It’s funny to note that the KPAX document contains the source for a Hello World application, the core of which is this Lisp call:

(defwebapp :helloworld
      (:root "/Users/tarkin/cvs/svc/kpax/example/helloworld/")
      (:prefix "helloworld")
      (:index "index")
      (:actions '())
      (:users (list (make-instance 'web-user
                                   :id 101
                                   :short-name "guest"
                                   :full-name "Guest User"
                                   :password "trustno1"))))

It’s even funnier to note that I’m almost guaranteed to get email from someone complaining about how hard Lisp is to read, but who doesn’t mind reading XML config files.)

Just today, during the blog roundup, I saw Chad Fowler and Rich Kilmer blogging about RubyGems, the Ruby package installation system they and others wrote this weekend at RubyConf 2003. From Rich’s blog about RubyGems, here’s what an example package definition looks like:

require 'rubygems'

    spec = Gem::Specification.new do |s|
      s.add_dependency('rexml', '> 2.7.0')
      s.name = 'jabber4r'
      s.version = "0.5.0"
      s.platform = Gem::Platform::RUBY
      s.summary = "Jabber4r is a pure-Ruby Jabber client library"
      s.requirements << 'Jabber server'
      s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")}
      s.require_path = 'lib'
      s.autorequire = 'jabber4r/jabber4r'
      s.author = "Richard Kilmer"
      s.email = "rich@infoether.com"
      s.rubyforge_project = "jabber4r"
      s.homepage = "http://jabber4r.rubyforge.org"
    end

    if $0== __FILE__
      Gem::Builder.new(spec).build
    end

Again, you may be able to find a few reasons to prefer XML, but the readability and simplicity of the Ruby version is indisputable, and a lot of power comes from having everything be within the language. A lot of power.

Also from RubyConf, one more answer to where we went wrong with J2EE, and Java in general. Matzthe inventor of Rubytitled his keynote address How Ruby Sucks. Java folk have always taken the language too seriously. It’s too late nowit would incite an irrational panic among Java developersbut we might be in a much better place today if, about five or six years ago, James Gosling had been able to deliver a talk about Java in that same spirit.

Richly Blessed

Today is my fortieth birthday. And it has been the best birthday I’ve ever had.

There are many reasons, but the biggest one is that last night my wife threw me a wonderful surprise birthday party. The surprise was complete. 36 friends had dinner at our house, representing nearly every important part of my life. Many of them my wife had never met, but managed to contact through other friends or sheer resourcefulness. Several people helped her plan and execute the deed, including a few who couldn’t make it themselves (but they helped Deborah find other friends, or made sure I was free last night, or provided cover stories for some of the weird things that happened as part of the planning, or sent cards or gifts). One friend drove up to Dallas from San Antonio. And to top it all off, Patrick Linskey (one of my NFJS buddies) flew in from Boston. Thank you all very much.

I got some cool giftsbut the night wasn’t really about gifts, except the tremendous gifts of the presence of my friends and the amount of work that had gone into making this milestone a special one.

God has blessed me with a big group of wonderful friends who care about me, two handsome, terrific boys, and a wife who is beautiful, smartnot to mention more devious than I knewand who made it clear that she loves me very much.

How could turning forty be anything but fabulous in the midst of all that?

Things I Miss The Most

For a while, at least, I’ve set aside the Powerbook during the day, and am exclusively a Windows guy while at work. Mostly it’s not bad; the annoyances that have always been a part of Windows are only slightly worsened by the past year’s association with OS X (and I’ve continued to use Windows a lot during that time, anyway). But there’s one thing I’m having a very hard time living without: iChat.

It’s amazing how subtle user interface design is, and how important it is. When I first saw iChat, the only thing that was noticeably different about it was the little speech bubbles, and I saw them as useless eye candy. I was sure the first thing I would do when I got iChat would be to turn them off. And it was the first thing I didbut I almost immediately turned them on again. The bubbles, with their different colors and different alignment (your own icon is on the right, the other person’s on the left) makes it much easier to distinguish different parts of the conversation.

Now that I’m using AIM again, I’m noticing all kinds of things that (like a comfy Eames chair) you don’t appreciate until they’re gone:

  • Automatic logging of all of your chats. I’m a guy who uses his email archive as an extended memory, and one of the things that was initially troubling about instant messaging was its transience. iChat made that a non-issue.
  • Every-five-minutes-or-so timestamps in the chat window to help track the flow of time in the conversation.
  • Sorting the buddy list by status (online and active at the top, then idle, then away, then offline). The list of people I could actually chat with right away nearly always fit on the screen in iChat; now I almost always have to scroll. And while using iChat, I never once missed the categories that AIM allows you to sort your buddy list into.
  • Status message displayed in the buddy list. Many Mac users have begun using iChat as an awareness tool, updating their status messages frequently to indicate where they are or what they’re doing. I miss that, not just because it helps me feel connected to my friends, but it lets me know when it’s a good time to interrupt.
  • Buddy icons displayed in the buddy list. A few friends change their buddy icons frequently, and meaningfully. (Like when James counted down the days to Panther’s release with screenshots from the “time remaining” display on Apple’s home page.) It’s fun to watch, and now I feel like I might be missing something.
  • Display of real names instead of AIM screen names. Who are these people in my buddy list? I have no clue who some of them are. I’ll have to check my Mac address book sometime to put names with IDs again. (Display of real names has another advantage: concealment of my friends’ AIM ids, which many people like to keep private.)
  • Much easier (and more elegant) sending of files between users.

Those are mostly in order of priority. If anyone knows of a Windows-based AIM-compatible chat program that supports most of these features, especially the ones near the top of the list, please let me know.

The race is on!

I know a lot of people who’ve been waiting eagerly (and not altogether patiently) for Apple to finally update the 15-inch Powerbook. Mike Clark wrote his own switch commercial to advertise his impatience.

Now they’ve finally made the announcement, just as you might expect, Mike and others like him are making their moves:

Shows how much I know …

This weekend I debuted two new talks at the Great Lakes Software Symposium: “Tag-Oriented JSP Design” and “Software Development Heresies.” They were both well received, and at the same time I got some good feedback that will improve both talks for next time. That’s the ideal situation.

It was a funny process, though. When I proposed those two talks, I was very excited about Heresies and thought that Tags would be “just another tech talk”—good, but nothing particularly special. Then as I was preparing the talks, my opinion reversed: Tags looked like a great talk that people would be really pleased with, and Heresies looked hazardous: if the audience didn’t want to join the discussion, it would potentially be 90 minutes of Glenn Vanderburg mini-rants, and even I think that gets old pretty quickly.

The actual outcome, however, was yet another reversal. As I said, they were both well received, but Heresies was the one that really rocked. Everyone was interested, there was a lot of energy in the room, and a lot of interaction. Two comments from evaluations have me walking on air: “Nice job of turning my world upside down” and “… you were by far and away my favorite speaker with the ‘Software Development Heresies’ talk.”

The smart thing to do with speaker evaluations is to treat them like figure skating scores, throwing out the lowest and the highest. So that last one gets thrown out of the official tally, sadly … but I can still bask in it for a little while. :-)

And maybe I’ll trust my instincts a little more about what makes a good talk.

subscribe via RSS