Sunday, May 30, 2010

Languages are magical!

I love programming and though I am loathed to admit it, I also love my chosen programming languages. Like many programmers I act like there is "one true path", the one true path is of course Python! Many a writer has been down this road before, yet I am still compelled to do the same. Why? Because I noticed something about myself that both surprised and disappointed me, I get angry when I hear someone bad mouthing Python.

I would like to think that I am above all that, that I and all those who are truly enlightened have long since moved past Vi versus Emacs, Perl versus Python, Dynamic versus Static typing and dare I say it even Windows versus Linux. I am wise therefore I know that these things all have different reasons for being and different places in history, thus a direct comparison of their merits and demerits is a fool's errand. Yet even here in the programming ivory tower, things are not so simple.

If I were truly enlightened I would start every new project1 with an evaluation of the best tools to use, one of the most important being the programming language. The primary criteria for selection if I am being completely rational should be fitness for purpose. However it is almost inconceivable that unless I have no choice in the matter2 that I would use anything other than Python. There are of course cases where this would be completely insane. When I am tinkering with the Arduino I use Processing, a great language it's own right, other than that I default to Python.

Much ink has been spilt addressing this issue directly, but I got more clarity from writers that were addressing orthogonal and indeed probably more important issues than the programming language wars. Eben Moglen the brilliant lawyer/historian/activist and once programming language designer said when Graphical User Interfaces were first becoming popular he did not perceive this as a good thing. In his opinion the key issue in computing was how we communicate with computers and each other, therefore language is where he thought at the time the focus should have been. In the context of Artificial Intelligence Terry Winograd and Fernando Flores in their book: Understanding Computers and Cognition -- A New Foundation for Design  placed similar importance on language when create what became known as the Language/Action Perspective. They said: "our position therefore in accordance with the preceding chapters is that computers cannot understand language"3. Concluding that since we cannot get computers to understand language: "software is unlikely to ever exhibit intelligent behaviour". These statements purportedly caused the nuclear winter in AI, but I digress.

What I take from all of this is that language is really powerful, powerful to the extent of appearing magical. Since it is magic, once you know one kind of magic, like the queen of Narnia it is inconceivable to us that there may be a deeper magic, of which we are not yet aware. So why do we obsess about our programming languages? Simple, because languages are magical!



Footnotes:

1.Ok maybe not every new project, it would probably not be a good idea to write three web applications in succession with different tool-sets.

2.For example if I join an existing project already using certain tools.

3.The original paper is from mid-1980's, in the fullness of time they may be proven wrong but that is what they said at the time.

Sunday, May 16, 2010

Why is it hard to recognise crappy software?

A few years ago I had a commute to work that took over an hour and involved a couple of different modes of transport. I had a very short walk to the Luas1 which took me to the City Centre. Once there I had a fifteen minute walk to catch a private bus service that ran and still runs I assume between the City Centre and a business park in the middle of no where. For some reason I always seem to end up working in difficult to get places.

Most of the time this was not too bad, a twenty five minute tram ride followed by a fifteen minute walk then a twenty five minute bus ride and I was there. This was not as bad as it sounds and it gave me one and half hours a day to myself. I got though a lot of reading those days and sometimes I even miss it a little, then I come to my senses! You see the, "just over an hour journey" was the ideal scenario, all too often the private bus was very late or did not show up at all. We were often left waiting there and when we called the bus company's office we got the standard line "he is just around the corner". Which was funny as the bus stop was close to a junction and we could see pretty much around every corner.

Forced to stand together for protracted periods of time and united by our common hatred of the bus company, strangers start to talk to strangers, strangers who over time (years in my case) become bus friends, then real friends and sometimes even good friends. It was on that bus that I met a friend of mine, who a few years later hired me for a great job and became my boss, so it wasn't all for naught. He loved and still loves a good metaphor, don't we all?

One my favourite metaphors he came up with2 was to do with why it is hard to recognise bad software until it is too late. One day on the bus ride home (the bus was on time that day, saints be praised) we were discussing why it is hard for consumers and businesses alike to recognise crappy software. We were not breaking any new ground we were just having one of those discussions that programmers like to have. We talked about complexity of course, about user eduction and so on and so on. When we were came to how the inner workings of software are mostly hidden3 and how it is different in other fields he said this: "Anyone can make a table by taking a piece of ply-wood and hammering in some 2x4s for legs, but everyone can tell the difference between that table and a table made by a skilled carpenter".

The problem with software is that at first glance there can be no difference between the two tables and with a good coat of paint it can be near impossible to tell the difference until you take the table home arrange a fancy dinner party and make a terrible mess!





Footnotes:

1.For those of you that do not live in Dublin, "Luas" is "Fast" in Irish, it is a street going tram that is really handy if you happen to live on one of the only two lines.

2.I am not saying he was the first to make this analogy, but I first heard it from him.

3.In closed source software at least and even open source software to the average non-programmer computer user.