Patches, Refactorings, and Enhancements
Not all code is equal. More specifically, there are three distinct kinds of code changes.
I distinguish between different kinds of code changes this way:
- patch – a code change that doesn't change intended behavior but does change actual behavior
- refactoring – a code change that doesn't change actual behavior
- enhancement – aka requirements change, a code change that changes both intended and actual behavior
(Also see Version vs. Patch
and What Is Behavior?
.)
Refactoring is part of development. It's probably not worth the risk to redeploy working code that has simply been refactored, but refactoring is a necessary, continuous activity to make sure the actual code continues to match intentions, even as intentions change and understanding evolves. Code has two audiences--the computer that has to run it and the developer that has to maintain it--and you want to make sure it speaks to both audiences well. Code that works speaks to the computer; refactoring make it speak to the developers better.
Patches are never desirable, but often necessary. If you deployed perfect, bug-free code the first time, you wouldn't need to patch it. But bugs are a fact of life, bug fixes are necessary, and so therefore patches are necessary as well. When users need a patch, they need it fast, so you need to be able to deploy patches quickly, easily, and frequently. This is one of the advantages of server-based software; it's easier to test and deploy a patch to "one copy" (a cluster, really) of an application running on a server than it is to patch a client application installed on thousands of workstations.
Enhancements are where the money is. These are new features and improvements to existing features. (At what point is an existing feature so improved that the improvement itself is really a new feature?) This is the glory part of development, but a surprisingly small part of code's total lifecycle. Most new code never makes it to deployment. (How many projects where you wrote perfectly good code (or not so good code) where canceled?) Code that makes it to production often needs to be patched and refactored just to make it keep doing what it was always supposed to be doing, which is why more effort goes into maintaining deployed/legacy code that was spent developing it in the first place.
So regardless of what language you develop in, what methodology or architecture you use, or what platform you deploy on, these are the kinds of code changes you make. What coding have you done today? What kind of changes were you making?