Care for your code

Your code is a living thing. Like any living thing, it changes constantly. Old parts die and sluff off. New parts grow to replace them. Your code goes where the customers take it. One day it needs to spend all of its waking hours in the burning sun. The next it might be whisked off to the frigid tundra. Wherever it goes, you go with it, and your code depends on you to take care of it!

Care for your code!

Let’s make sure we call out that your code needs direct care. Just like a pet, your code needs to be cleaned periodically. It also needs to be groomed. You can’t let those fingernails grow too long. You must not neglect to brush your pet. It’s important to keep up with regular medical and dental visits. Preventive care, like vaccines, are important. Apply security patches. Upgrade dependencies. Remove dead code. Make sure failing tests get fixed. I can’t forget to mention that you need to watch your code for any concerning changes. If your code starts shedding hair for no obvious reason, its not time to sit back and hope that things get better.

Care for your code!

Your code needs a lot of supporting accessories. It needs memory (physical and logical), bandwidth, and data. It also needs at least a development environment and a production environment. Most of your code needs one or more of an integration, QA, staging, UAT, and/or performance testing environment. (Maybe more.) That means you need build pipelines with build, deployment, and dependency management servers. Your code also needs supporting services and databases. Not only do you need the direct databases or services that you depend on, but you also need monitoring infrastructure.

Care for your code!

For all of these things, you should have a way to go from newly unboxed server or a newly created virtual machine to fully functioning environment in less than a day. Its best if this is automated and you do it often. The point is: just like a fish tank, the environment around your code needs care. Keep an eye on it and clean it up regularly. Change the water and the filter. Vacuum the gravel.

Care for your code!

What about regular use and inspection? Does your code get enough? Do you exercise the code? I don’t mean by your customers. End users are total strangers who have no connection with your code, and who expect you to take care of it enough that they can get done whatever they need to get done. Those people aren’t there to exercise your code. They need something from your code. If your code were a horse rented to tourists in the Grand Canyon, you wouldn’t put her in the stable at night, and take her out in the morning for the next unsuspecting sap, without going over every inch of her to make sure she’s still in shape for the task.

Care for your code!

I know it’s easy to think that code is a static entity. Just words in a file somewhere. Something that sits there and does its job. Just another company asset like a desk or a whiteboard. But this is not the case. Code is alive and code matters.

Care for your code!

Leave a Reply

Your email address will not be published. Required fields are marked *