Back from QCon

March 15th, 2008  |  Published in commentary, conferences, erlang  |  Bookmark on Pinboard.in

I just returned home from QCon London, and its excellence exceeded my expectations. As usual, the quality of speakers QCon attracts (just like JAOO) is outstanding, and they cover a very wide variety of topics.

Kent Beck‘s keynote was excellent. It was about developer responsibility, developer integrity, and the relationships developers have with those around them (here’s a good summary). Extremely insightful, not unexpectedly of course, and covering important topics that are unfortunately often taboo among technical folk.

It’s been awhile since I spent any quality time with Kent, but we did manage to sneak off to a back room at the speaker party on Thursday evening and get 20 minutes or so of conversation in, which is better than nothing. Given that the first two to drop in were Jim Webber and Joe Armstrong, though, neither of us minded the extra company. Generally, though, I think I could easily spend a couple solid days talking to Kent about development issues.

I spoke in Stefan Tilkov‘s track on Thursday, and I thought it went OK. Stefan has already provided detailed notes on each talk (except his own, which was really good) on his blog, so I won’t bother with repeating any of that. I got to meet Paul Fremantle in person for the first time, which was nice, though I have to say I remain puzzled by his “REST is too hard for the average developer” claim he made in his talk, since it definitely doesn’t match my recent experiences with watching others learn it and apply it. I’ve heard Sanjiva say the same thing before as well, so I wonder if it’s just something they keep telling themselves, hoping it will come true if they repeat it enough. ;-)

On Friday I thoroughly enjoyed Simon Peyton-Jones‘s Haskell talk and Joe Armstrong‘s Erlang talk. Both were excellent speakers, and both talks ventured into areas that I’m sure many of the attendees were not familiar with, so I’m sure most everyone who listened learned a lot. Thankfully there were no “Haskell vs. Erlang” wars, but that’s not surprising given that Simon and Joe are friends, plus they know that that argument serves neither language.

The best part of the week, though, was getting to meet and hang out with Joe and other Erlang folk. Joe’s really an excellent guy. He’s quite energetic, and his brain just doesn’t stop. He’s curious about a lot of technical things beyond Erlang, and I found discussions with him to be full of interesting questions and insights. Given the fact that I work with Erlang quite a lot these days, my hope going in was simply that I’d get a chance to just say hi to him, but I turned out to be lucky enough to spend many hours with him over the course of the conference. I also met Francesco Cesarini, a well-known and long-time Erlang consultant, whom I’m sure has probably forgotten more Erlang than I’ve learned so far. I also met Alexis Richardson, who works on RabbitMQ, the right way to implement AMQP. Francesco graciously invited me to speak at the Erlang Exchange this summer, so I’ll be seeing them all again before too long to talk even more about what’s quickly become one of my favorite programming languages.

Congrats to Floyd, Kresten, and the whole QCon team for putting on yet another excellent conference. I’m looking forward to JAOO Australia (in both Brisbane and Sydney) next!

Damien Katz Criticizes Erlang

March 10th, 2008  |  Published in code, erlang, functional  |  3 Comments  |  Bookmark on Pinboard.in

Damien Katz has been using Erlang for CouchDB, and has posted some criticisms of the language and runtime based on his experiences with them. Erlang, like any language, has its issues, and Damien’s criticisms are mostly reasonable and are worth reading. Well, except for this one:

Immutable variables in Erlang are hard to deal with when you have code that tends to change a lot, like user application code, where you are often performing a bunch of arbitrary steps that need to be changed as needs evolve.

In C, lets say you have some code:

int f(int x) {
x = foo(x);
x = bar(x);
return baz(x);
}

And you want to add a new step in the function:

int f(int x) {
x = foo(x);
x = fab(x);
x = bar(x);
return baz(x);
}

Only one line needs editing,

Consider the Erlang equivalent:

f(X) ->
X1 = foo(X),
X2 = bar(X1),
baz(X2).

Now you want to add a new step, which requires editing every variable thereafter:
f(X) ->
X1 = foo(X),
X2 = fab(X1),
X3 = bar(X2),
baz(X3).

If you had to write that code the way Damien did, then yes, that would suck. But here’s a better way to write it:

f(X) ->
    lists:foldl(fun(F, Last) -> F(Last) end,
        X, [fun foo/1, fun fab/1, fun bar/1, fun baz/1]).

This code applies the anonymous function passed as the first argument to lists:foldl for each element of the third argument — the list of funs, Erlang-speak for functions — starting with the value X as the value passed as Last and using the return value of F(Last) as the next value of Last. The overall return value of lists:foldl is the final value of Last. With this approach, modifying the functions applied to X also requires editing only a single line, specifically the list of funs.

In general, if you’re used to imperative languages and you find yourself writing step-by-step Erlang code like in the original example above, think functions and lists instead.

P.S. If you’ve never seen it, read Damien’s Signs You’re a Crappy Programmer (and don’t know it). One of my favorite blog postings, and I especially like the first two items in his list.

RESTful Data

February 28th, 2008  |  Published in column, coupling, integration, REST, scalability  |  2 Comments  |  Bookmark on Pinboard.in

In my Jan/Feb Internet Computing column, Serendipitous Reuse (PDF), I talked about interface coupling and the benefits of REST’s uniform interface constraint. I find that whenever you discuss that topic, though, REST detractors tend to say, “Well, you’re just pushing the coupling problems to the data.”

The problem with that assertion is that it assumes coupling is a fixed constant — if you eliminate it from one point, whatever you’ve gotten rid of just has to pop up somewhere elsewhere, like some sort of strange “Conservation of Coupling” law. Of course, that’s not true. In my latest column, Demystifying RESTful Data Coupling (PDF), I turn my attention to this claim and explain how RESTful data works, and why it too, like RESTful interfaces, reduces coupling when compared to WS-* and other similar approaches.

Constructive feedback welcomed, as always.

InfoQ Interview

February 26th, 2008  |  Published in commentary, conferences, CORBA, distributed systems, dynamic languages, erlang, HTTP, interview, productivity, REST  |  3 Comments  |  Bookmark on Pinboard.in

When I spoke at QCon San Francisco last November, Stefan Tilkov interviewed me, and the video is now available on InfoQ.com.

We covered a range of topics: CORBA, dynamic languages, REST, distribution, concurrency, Erlang. Stefan asked some great questions, and I hope I gave some worthwhile answers. Thanks again, Stefan.

Six Degrees, Capone, and me

February 15th, 2008  |  Published in General  |  Bookmark on Pinboard.in

A bit off the usual topic of this blog, but yesterday being Valentine’s Day and all, late in the evening I was busy doing what no doubt a whole lot of other people were also doing: watching the documentary of “The St. Valentine’s Day Massacre” on The History Channel. The St. Valentine’s Day Massacre is, of course, the name given to the event in 1929 in which members of Al Capone‘s gang murdered seven people either in or associated with Bugs Moran‘s gang.

The phrase “six degrees” in the blog title refers to “Six Degrees of Separation,” which is the idea that each person on the planet is separated from everyone else by an average of only six steps. Each person you know is one degree away, each one they know but you don’t is two degrees away, etc.

During the show, a picture flashed on the screen that reminded me of how many degrees of separation there are between the infamous Al Capone and me: only two. The picture was that of his older brother Ralph, whom I met as a child. Ralph lived in the Sky View Nursing Center in Hurley, WI near where I grew up in Upper Michigan. The mother of one of my teachers also lived there, so that teacher would occasionally take the whole class over to visit the elderly people in the center, bring them small gifts we’d make in class, have us sing songs to them, and have each of us visit with one of them individually. By sheer luck I was assigned to visit Ralph Capone. I don’t recall him saying much, but when I saw his picture in the documentary last night, I wished that I knew then what I know now. Think of the questions I could have asked him!

He died in 1974, not too long after my visits with him, and my mom cut out his obituary from the Milwaukee Sentinel and gave it to me. I still have it in a scrapbook.