Sunday, June 3, 2012

The 'everyone should learn to code' dilemma

Back when I was working on software for fire departments, we started thinking about reworking a critical piece of our solution: deployment plans. In a fire department domain, deployment plans help to make a suggestion to the dispatcher about which units should be dispatched to a location when an incident is called in. The suggested composition of units depends on a wide range of variables: availability, response time, ranks, type of incident, required tools, ... , even politics. Originally, people high enough in rank could compose these plans using a decision tree-like UI. However, as it turned out, this UI was insufficient; not all variables and conditions were available. Since this was no custom built tool, we had to work around it by composing incomprehensible decision trees or by tricking the underlying services. When talking about how we could do better, we hit a wall pretty soon. We thought about building our own - but more extensive - UI, and damn, even designing a DSL crossed our minds.
Along the process, I heard that Configuration Complexity Clock ticking, and I couldn't stop myself from thinking that if everyone knew how to code - just some boolean logic and control flow would suffice -, we wouldn't have gotten into this mess. It seemed impossible to build something that would be intuitive, and still fulfill all the requirements; some things just seem to be best expressed in code.

I empathize with the proponents of teaching everyone how to code. On the other hand, I've been watching this movement from a safe distance; there are two sides to the same coin.

Just a few weeks ago, a peer shared one of those horror stories which originate when non-professional developers take matters into their own hands. The IT department of this big company was looking for a piece of software which could standardize the way employees make hardware and support requests. Shopping around, they found the existing products couldn't satisfy their needs, or they would take a considerable cut out of their yearly budget. Eventually, a system administrator who knew just enough about programming to be dangerous stepped up, and rolled his own tool. For over two years, all was good with the world. Maybe the solution wasn't very pretty, and a bit on the slow side, but overall - and most importantly - it got the job done. Now, the original developer has decided he can't be bothered maintaining his brainchild any longer. The peer who told me this story, was also the guy chosen to take over maintenance and feature requests. They assured him that it wouldn't be too much trouble; just a little feature here and there, and maybe the exceptional bug. What he found however, were the things nightmares are made of; a - classic - ASP.NET web application with just one web page, written in VB.NET, containing over 20k LOC, with updatepanels nested five levels deep.

And this is the perfect example of how we have to be very careful with the 'everyone should learn to code' meme. Slinging code is easy, but writing good code is hard, and takes a lot of practice. Software might be eating up the world, but maybe it's for the best we don't turn it into a monstrous glutton.

6 comments:

  1. This kind of software isn't just written by admins overstepping their competence, but also by very expensive contractors - just take a look at thedailywtf.com once in a while.

    ReplyDelete
  2. There are more than a few commercial software companies out there with 20KLOC main-modules in their primary business app. And professional software developers often built it.

    W

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. I think it's pretty weak that *everybody* should learn to code and learn about programming but we don't want them writing code. Surely you have to pick one or the other, given the amount of things everybody has to learn in a modern education already, it's more of a nice to have.

      If you're talking about "everybody working in a technology company", then it's much more understandable, yes, everybody should have an understanding of how programming works and the limitations etc.

      Delete
    2. I agree, I'm all for educating people. But still, that's going to be hard as well. I graduated CS with good grades, and still had no clue what software was all about.

      I once had basic electronics at school, but today I still can't estimate how hard it would be to install a domotica system - "Just plug the wires in right?".

      Delete