Blue Sky On Mars

Thoughts on Building Software Products

So that’s where Doug FM came from!

by Kevin Dangoor

A couple weeks ago, one of the Detroit pop stations mysteriously switched formats and started calling itself “Doug FM”. They described their new format, if I recall correctly, as being like you “dropped your iPod in a can of paint”. What it boils down to is that they don’t have a 25 song playlist of current music in some format. They play a variety of things from the 70s, 80s and early 90s (I haven’t heard more recent than that on there).

It turns out that Doug is part of a new breed that also includes Bob, Jack, Dave and other radio stations.

GET, POST, PUT and DELETE in REST

by Kevin Dangoor

No, I’m not yelling in the title. I’m just following up on Dare Obasanjo’s post about misunderstanding REST: A look at the Bloglines, del.icio.us and Flickr APIs. Dare’s complaint is that these services all have URLs that have side effects via HTTP GET. This is an interesting distinction to make.

I just set up a new Drupal installation, and I’m reminded of Drupal’s cron.php. cron.php runs whatever periodic maintenance tasks are needed. In other words, it changes data. But, you really want to use GET in that case, because it makes it trivial to add a wget crontab entry to ping it periodically.

My own app keeps does housekeeping as links are clicked, which is far easier via a GET than to rig up a POST via JavaScript. Maybe the difference here is whether or not one is making a claim of a RESTful interface. Or maybe the difference is how caught up in the semantics of it one is. Josh Alen has a good comment on this:

people chose between GET and POST based on other critera than suggested in the Fielding paper

I think this is on target. If you’re conciously providing an API for the public to use, following the RESTful standards that Dare mentions is worthwhile, because it helps with the principle of least surprise. But, you also need to look at the overall convenience of what you’re doing… if you have a good reason to bend the rules, do so and make sure you document it. If it’s truly a good reason for rule-bending, it shouldn’t really take people by surprise or throw them off.

This makes me think of the general notion that APIs are a user interface for developers. In Swing programming, to add a widget to a window you had to do this:

frame.getContentPane().add(somewidget)

This is the “correct” thing to do, because the JFrame object itself is not actually a container for UI widgets. But, it has a container: the content pane. Correct or not, it was annoying. Java 1.5 now allows you to do this:

frame.add(somewidget)

Though it is less “correct” for the architecture, I think this is more inline with what programmers expect and want to do with the API.

I don’t know if this is the case with the Bloglines, Flickr and De.licio.us APIs, but my main point is that there are times when user experience is worth more than “following the spec”.

F-Script Anywhere (and Mac OS X) are very cool

by Kevin Dangoor

F-Script is a Smalltalk dialect for Mac OS X. Clearly, many in the Mac community are already aware of F-Script, since it won an Innovators Award in 2003. I’d imagine many are always aware of F-Script Anywhere, which allows you to attach F-Script to any Mac OS X program. I wasn’t aware of this until yesterday, so I just had to say “wow! that’s cool!”.

Using F-Script Anywhere, you’ve got an object browser that you can use to poke around at the various objects in a running program, sending messages and getting responses back. Within a couple minutes of download F-Script Anywhere, I was able to send JavaScript commands to my running Safari window. Mac OS X has the coolest software architecture around.

Speaking of the Mac OS X software architecture, Apple has an open source package called Core Foundation Lite, which provides a number of the base classes used in Cocoa development. I knew that Mac OS X’s kernel was open source, but I didn’t realize that some of the framework code was also open source. CFLite is still quite low-level, but it is a way to move some code between platforms.