Wednesday, 27 February 2013

Love, and do what thou wilt

Do you work in a company that has good process? Are there clear written procedures for every task? I used to work in such a company, and ironically it was quite liberating. It certainly makes it easier to tell someone else that they aren't doing their job properly. But it always struck me as odd to be working on Object Oriented code, but in a Procedural manner.

Objects (responsible objects in a well designed system) take responsibility for their own concerns. They encapsulate approaches to problems and do not entangle their collaborators in the complexities of their own workings. Yet they are happy to rely on others when a problem arises that is more properly the concern of another object. When exceptional circumstances arise they escalate the problem directly upwards with a transparent description of the problem.

I've also worked in a company without clear written procedures for every task. It is more Object Oriented. Developer responsibility is highly valued. But of course with Freedom, Responsibility is not just available, but necessary.

Naturally I prefer the latter. All Code is Evil. Not just that written in Processing or Haskell, not just that written in Company Procedures, but also those behaviours that we follow without thinking, the code of society. Societies have undoubtedly been codifying their own behaviour since before they began recording it. So ask yourself: "How do I approach a codebase that is several thousand years old?"

Any system of that age - and I mean the kind of age that changes things - must surely have accumulated a lot of cruft. Dead code that should have been removed from the repository long ago, but which (either through being complected with valuable ideas, or simply by misunderstanding or oversight) has remained in play. Code that was once valuable, but whose time has passed. Code that was always just a crazy experiment, but was never validated and somehow survived.

Any system of that age must also be successful. On these timescales only the fit survive. When things get difficult it is reassuring to have clear Procedures to turn to. Perhaps it is only in times of relative comfort and success that we can afford the luxury of individual freedom and responsibility. But a system that can survive through thick and thin must surely have something to offer. A core of good ideas. Some real functional value. Or else a historical accident would have wiped it out by now. Its very tempting when dealing with an old codebase to throw the baby out with the bathwater. To declare: "I can do better!" Tempting. But sometimes misguided.

One such gem, of which I was recently reminded was this saying by St. Augustine, a 5th century bishop: "Love, and do what thou wilt." Which is to say, as long as your intentions are correct, your exact course of action need not be prescribed. He seems to be advocating individual responsibility over blind obedience. A more Object Oriented approach over a Procedural one.


No comments:

Post a Comment