The powers that be probably won’t like it all that much but programming remains an art. To those who want to argue that it is a craft instead I say: a craft is just a special form of art. So we are both right. That doesn’t have a lot to do with the stuff below but I wanted to get it out of the way nevertheless. The problem is that there is a large class of programmers who don’t share this opinion. There is even a special name for them: non programmers. In this post I like to talk about them for a bit.
Programmers in Disguise
If you consider yourself a programmer (maybe even a good programmer) then consider this: how many of the great people in our field do you actually know? For example, do you know who Jim Gray was? Alan Kay or Adele Goldberg perhaps? Martin Fowler? Edsger Dijkstra maybe? Yukihiro Matsumoto a.k.a. Matz? Why the Lucky Stiff? Guido van Rossum? Simon Peyton Jones? Alonzo Church? John Backus? Anders Hejlsberg? Not to mention a whole host of other giants. Most of them still active today. Note that I was about to link all those people to their respective pages but that was just starting to look like a giant search engine lure. If you really want to know more about them then I recommend Google videos. You’re abound to find some other interesting links too to start your research with.
Who doesn’t know about Douglas Engelbart with the Mother of all Demos in 1968!. Shame on you if you have not seen this before.
Some of the people I talk to and that pretend to be programmers haven’t even heard of these people. Now, that’s not too bad in itself. Knowing these guys doesn’t make you a better programmer but it does show something about the passion you have for the field that you are working in. It’s not whether you know them or not – it is about the desire you have to learn about them (you can abstract this to it’s not whether you know [A; B; n] or not – it’s about your desire to learn about [A; B; n]). Most of the times, they just shrug their shoulders and off they are, on their merry if-while-case away.
Often, I encounter this attitude with business people who know a little bit about programming. Maybe they programmed a VB app in the 90′s or maybe they know either the SQL Query Designer or (everyones favorite) FrontPage just a little bit too well. Sprinkle that with a suit and smooth talking skills and you have yourselves a business programmer. Usually, these guys are living in an ancient world where only while, if statements and global state seem to exist. The unfortunate fact is that they somehow seem to be able to get things done without any respect for the art (or craft if you insist). I can only use the words of Prince (as I ironically like to call him) when I say that those dudes still party like it it’s 1999. In fact, it’s even slightly worse but unfortunately that’s the best I can come up with so I’m being lenient.
A lot of times, these are the same guys that breed giganormous if-trees of loop, more if, while, more loop, case (we’re talking some serious VB here), even more while, more if, even some more if, another while, yet another while, yet even more if and then another case for good measure all in some humongous monster of donkey eating, steel shitting angry pile of smelly thing that those dudes like to call Sub.
Sometimes they even dare to call it a Function but at this point it doesn’t even matter anymore. You could just as well call it SmellyPileOfCrap Foo and nobody would even care. It would not even be that bad but the worst part is that all of this is copied meticulously over from another +6000 line method that does exactly the same as the other one except for one or two lines that are apparently not worthy enough to be duplicated. But then again, things only get really interesting when you find the same pile of crap duplicated across a bunch of other piles of shit. It’s like finding a cake of shit with other kind of shit sprinkled on top and then finding that same cake four or five times more in unsuspected places all scattered in something that resembles your house. It’s all one big fantastic crapfestaciacious vision of crapunholiness.
Just Being Pragmatic
Oh my sweet Jesus, do I like to talk about being pragmatic? Hell yes! See, you weren’t expecting for me to answer that question did you? You just assumed I was asking one of those fancy so called rhetorical questions? Well let me tell you sonny: assumption is the mother of all fuck-ups! And yes, I am aware that this quote is from an incredibly bad movie.
Still though, there is something magical about being pragmatic. Just look at the fucking definition that Google gives us:
pragmatic
A pragmatic way of dealing with something is based on practical considerations, rather than theoretical ones.
A pragmatic person deals with things in a practical way.
You know those agile guys? They are being pragmatic. You know what? Those functional guys? They are being pragmatic too. Just in a crazy mathematical kind of way. Those Ruby guys? Pragmatic. Python? Pragmatic. Lisp fanatics? Pragmatic. Unix kernel hackers? Pragmatic. The absolutely waziliously huge PHP community? Just being pragmatic (well maybe not all of them).
Looking at the definition, that sounds like something a business person would love. It even goes so far as to tell us that a pragmatic person deals with problems “based on practical considerations, rather than theoretical ones“. Now what’s not to like about that from a business perspective? In reality though it means a bunch of so called coding craftsmen working their ass off with the simple tools they have. From my perspective, it’s like watching a bunch of cavemen trying to rebuild the Twin Towers with a rock and a stick. The only unfortunate part that I am one of those cavemen.
So apparently, at least from this perspective, being pragmatic means behaving like a software cavemen and treat everything with familiar tools: a rock and a a stick. Or respectively, in our case, a while. and an if. The sad conclusion is that most of the industry is either not doing it or we are doing it wrong.
Those business people should like being pragmatic too but unfortunately they don’t think being agile is cool. They also don’t like someone hacking on their precious code. I can’t tell them a piece of code is shit anymore. I have to tell them that it is not exactly what I would’ve written. Even if the piece of code is something I wrote myself a few weeks earlier. They like guys who are being pragmatical by throwing a bunch of copied while and if loops at a problem until the problem seems to be solved. Then, when a few weeks later the issue regresses it is registered as new and solved by throwing yet another rock and stick, doing the lucky dance and hoping that no new bugs crop up.
The powers that be once told me to implement a look-ahead search for one of our websites. Unfortunately, the look-ahead would need to function with a particularly awkward set of columns and I knew this wasn’t going to happen with our current setup. First, I tried to convince them to building a set of indices for that particular set of columns so we could get to the results more efficiently. The fact that stuff would not be real time was just too much. Then, I tried asking for more raw power but in the end, the reply I got was a casual: “Google can do it too, so we can too”. Now that is being pragmatic I tell ya. Those so called pragmatic guys I mentioned before should take a page from his book and just take a look at Google.
Bonus
In fact, there’s another useful abstraction that I think of now that I’m writing this. If you are wondering whether some [A; B; n] is the right thing to do, ask yourself this: what if everyone did [A; B; n]? If the outcome is a positive vision then its probably the right thing to do.