They’re all just clients.

September 21th, 2008

Recently, a lot of people have been talking about the perceived importance of a formal education in Computer Science or Software Engineering for the average programmer. I happen to think that a person can certainly be self-taught in programming, but just “learning how to hack” in your spare time can leave you without a grasp of the fundamentals of writing good software. Many people have written convincingly on the importance of knowing the fundamentals, Joel Spolsky being one of the first to come to mind. (cf. Shlemiel the painter’s algorithm)

At any rate, I’m not writing about that today. Instead, I want to introduce an approach I recently took to developing a new web app. A few weeks ago I was faced with a common problem. I had this very simple, but very useful app idea that I wanted to have interfaces for web, iPhone, Android, voice, sms. I also knew that I wanted to provide a 3rd party developer API. The question was, how do I do this with the least duplication possible?

After thinking about the problem for a bit, I decided I was going to go old school for this one. I would write my API first and think of all user interfaces as clients to that API. You know, just like we all learned in our Software Engineering classes, if we had them. I mean, back in the day I was taught that you developed your API first — ultimately everything else is just a client. For whatever reason, this view seems to be less popular in the web app development world.

Increasingly, I’m finding myself drawn to a back to basics approach to web application development where I forego huge, monolithic apps for designing the API first and having a bunch of little micro-apps that are interacting under the covers to make my main app work.

Let me be clear: the whole API-first thing is certainly an issue on which reasonable people can and will disagree. As a matter of fact, I was having an interesting debate on the technical and business merits of this very argument with my friends Ahson Wardak and Luc Castera, the creators of a great little app called ShareMeme (if you’d like an invite to it, the first 20 to sign up with my invite code “pius” get in). I discussed the business pros and cons with @ahsonwardak and the technical side with @luccastera (who, incidentally, will be giving what I expect to be an excellent talk on the Ramaze microframework this year at RubyConf). There are definitely pros and cons to the approach.

Any cons notwithstanding, I’m very pleased with how this approach of treating all interfaces strictly as clients has worked out so far. In subsequent blog posts, I’m going to explore this idea further and introduce some of the Ruby tools I’ve been using to implement this API-driven design.


blog comments powered by Disqus

A blog by Pius Uzamere.

Come here to see his thoughts on web applications, business, his company, and life in general . . . all with the occasional code snippet thrown in.

The Archive
Recent Posts

About the Typography

I've just relaunched the blog and, for now, the typography used here borrows quite a bit from some of the superb patterns found here. Thank you for the inspiration.