[This post was inspired by a discussion last week in my “Biological Approaches to Computer Security” class.]
Let’s talk about living code and dead code.
Living code is code which can change and evolve in response to new requirements.Â Living code is a communications medium between the programmers of the past and those of the present.Â Together, they collaborate on specifying solutions to software problems.Â The more alive the code, the more active this dialog.
Dead code*, in this context, is code that is not alive.Â It does not change in response to new requirements.Â Dead code is part of a conversation that ended long ago.Â Some dead code is truly dead and buried.Â The code for Windows 1.0 I would characterize as being dead in this way.Â Other dead code, however, still walks the earth.
I call these entities code zombies.Â Others call them legacy code.
Code zombies died a long time ago.Â The programmer conversations they were part of have long ended, and nobody is left who can continue them from where they left off.Â Nobody understands this code, and nobody can really change it without almost rewriting it from scratch.Â Yet this code is still run, is still relied upon.
Look around you – you’re surrounded by code zombies.Â If you run commercial, proprietary software, you are probably running a lot of zombie code.Â If you run open source, there are many fewer zombies around – but they do pop their heads up every so often.
Enterprises devote huge resources to maintaining their zombies.Â Zombies aren’t good at taking care of themselves, and the repair jobs are often gruesome.Â Sometimes a zombie needs to be brought back to life.Â This can be done, at great effort and expense.Â The result, however, is Frankenstein code: it may live, but boy is it not pretty, and it may turn around and bite you.
And here’s a funny thing: zombie code is insecure code.Â Tamed zombies aren’t fussy about who they take orders from.Â Living code, however, is part of a community that works to keep it safe.
I predict that the software industry will transform once enough people realize the costs of keeping zombies around outweigh the benefits.
* I know”dead code” has other meanings in computer science.