Better Than A Bottle Of Wine

Another look back.

Here is probably the best speaker's gift I have ever received:

Usually, one gets bottles of wine, or pens or T-shirts. This gift is actually useful!

The conference was "InCite the Future, 2001" (I think…might have been the 2000 conference), organised by Software Engineering Australia (Queensland).

The organisation is now defunct (a victim of government myopia combined with petty jealousies and infighting personalities) and there's probably only a few of us die-hards around that remember it. Pretty sad, really.

I was helping out with the conference, as well as speaking, and one of the organisers asked what should be given to the speakers.

I said: "Anything but wine. I don't drink it and the overseas presenters won't want to take it back on the plane with them. You need something light that appeals to a nerd."

This is what she came up with. An excellent choice. I am a legendary nerd and it really hits the spot for me!

Inventing A New Statement for Groovy In ~10 Minutes!

So tonight I opened my big mouth on the Groovy user's mailing list.

Ruby has this (example from http://www.techotopi … _Ruby_case_Statement):

car = "Patriot"

manufacturer = case car
   when "Focus": "Ford"
   when "Navigator": "Lincoln"
   when "Camry": "Toyota"
   when "Civic": "Honda"
   when "Patriot": "Jeep"
   when "Jetta": "VW"
   when "Ceyene": "Porsche"
   when "Outback": "Subaru"
   when "520i": "BMW"
   when "Tundra": "Nissan"
   else "Unknown"
end

puts "The " + car  + " is made by "  + manufacturer

I asked: "Why shouldn't Groovy have the same?"

In about 10 minutes, Guillaume Laforge (Groovy's Project Manager and Head of Development) had come up with this:

def car = "Patriot"

def manufacturer = match(car) {
  when "Focus",     "Ford"
  when "Navigator", "Lincoln"
  when "Camry",     "Toyota"
  when "Civic",     "Honda"
  when "Patriot",   "Jeep"
  when "Jetta",     "VW"
  when "Ceyene",    "Porsche"
  when "Outback",   "Subaru"
  when "520i",      "BMW"
  when "Tundra",    "Nissan"
  otherwise         "Unknown"
}

println "The $car is made by $manufacturer"

def match(obj, closure) {
    closure.subject = obj
    closure.when = { value, result ->
        if (value == subject)
            throw new MatchResultException(result: result)
    }
    closure.otherwise = { return it }
    closure.resolveStrategy = Closure.DELEGATE_FIRST
    try {
        closure()
        closure.otherwise()
    } catch (MatchResultException r) {
        r.result
    }
}

class MatchResultException extends RuntimeException {
    def result
}

and the associated suggestion:

you could have that utility method be a static method on some class that you'd import startically.
For instance:

import static com.foo.Util.match

Then later on, you'd just have to do

def manufacturer = match(car) { … }

I am both impressed and horified. Impressed that Groovy is so adaptable (Guillaume has basically created a new language construct out of thin air). Horrified because I couln't have come up with something like that in my wildest dream and I doubt many others would be able to, either.

I tip my hat!

[edit]
Another suggestion came from Dr. Paul King:

car = "Camry"

def getManufacturer() {
  switch(car) {
    case ["Focus", "Fiesta"]        : return "Ford"
    case "Camry"                    : return "Toyota"
    case { car.endsWith('back') }   : return "Subaru"
    case "Ceyene"                   : return "Porsche"
    case ~/5\d\di/                  : return "BMW"
    case "Civic"                    : return "Honda"
    default                         : return "Unknown"
  }
}

println getManufacturer()

Doable now, in a failry straightforward way, using the powerful capabilities of the enhanced switch

I still think that Groovy would be slightly more powerful (==simpler) with the added statement but that's just IMHO; it's not a showstopper…

Tags: Groovy, Programming

Not The Future We Planned…

I have been reading science-fiction since I was about 10 years old and the only author to come close to predicting the modern world was Robert Heinlein.

He 'predicted' (or rather he used the idea as an overarching background for several of his stories) what he called the "Crazy Years." If memory serves aright, we are pretty much slap-bang in the middle of them…

Even he didn't predict the world as revealed above, though.

Tags: Rant

Experiences From The Aunty

From the BBC's Radio Labs: Designing and building data driven dynamic web applications the one web, domain driven, RESTful, open, linked data way.

Would be nicer if they made websites that were more than a few centimetres wide, but there is wisdom here, nonetheless.

Tags: Tools

97 Things Every Software Architect Should Know

An interesting conversation going on over at TheServerSide.com discussing the parables and war stories collected here.

Is Agile Development More About Culture Than Process?

Very interesting blog post over at AgileProductDesign.com.

Hmmm?

Having watched (and participated in) a number of research teams (who of course always claim to be at the forefront of movements such as Agile) at work and play, I'd have to say "yes."

I'd also have to say "be careful with the culture that you allow to develop since an undesirable culture may lead to undesirable processes."

You may end up with a culture that places undue value on a team member having his own local cache of Dilbert comic strips and thus having a process in place that supports said team member effectively going on strike until same is not supplied (true story!).

Aside from that, I'd certainly be happy with the idea that the persistence of the Waterfall software development process is a product of a culture. That culture might be dysfunctional, inadequate and dated, but there is often notably a cultural aspect to the reason why so many organisations keep slogging along with Waterfall.

Tags: Agile

More T-Shirts!

Apologies if this site seems to be becoming more about clothing/baggage than about IT!

This T-shirt is a fairly recent acquisition, from the Energex/SPARQ TCE Project that I have written about before:

This one is a lot older:

It was given to me by one of the Enhydra guys in December 1999 at the Linux/Open Source Bazaar, Jacob K. Javits Centre, New York. I was presenting a 2-day tutorial session on Linux (RedHat 5.2).

My "body clock" was exactly 12 hours out of alignment but it was a lot of fun. For example: the organisers arranged for us to have free, unfettered access to the famous FAO Schwartz Toy Store for a night…the perfect entertainment for a bunch of geeks! Another choice moment: watching the audience practically boo Corel CEO Michael Cowpland (I think; might have been RedHat CEO Bob Young….my jet-lagged memory is a little hazy here but it keeps pushing a fedora at me…) offstage for daring to suggest that Linux would eventually have to be commercialised and become a money-making product before it could actually "rule the world." Richard Stallman and Eric Raymond were practically having fits, as were many of the faithful in the audience. How times have changed…

This was pretty much the first 'real' Transentia engagement, so this T-shirt really does bring back a favourite memory.

Tags: Retrospectives

SOA & The Tarpit of Irrelevancy

InfoQ précis a nicely down-to-earth examination of "the state of SOA/BPM software and its vendors."

Here's a taster:

While rank and file developers go to conferences to soak in deep technical content, their peripherally technical managers (the ones who wrote some rockin' good Cobol code back in the day, but now they make decisions about modern enterprise architecture) go to different conferences in Palm Springs. At those conferences, they have a 2-hour morning session, run by a big tool vendor, then play golf for the balance of the afternoon. And what the vendors show them is poison.

I just love the term "doodleware" the author introduces!

It's a curious thing: just yesterday I was pontificating on a similar theme to a colleague; it's nice to know that my cynical world-view is not completely in my own head, after all…

Perhaps the author wanted something along the lines of grailsflow?

Tags: Grails, Programming, SOA

How's the Agility?

Check this site out: http://www.abetterteam.org/.

An interesting idea.

The site associated with the 'parent' book is also well worth a look-through.

Tags: Agile

Inspirational

This is my cat, Furball.

Clearly, Furball feels that she is in the right place, at the right time, doing the right thing.

A state of being to aspire to, I say…