The Code We Don’t Write
1. Write As Little Code As Possible
The best code is no code at all. If we can complete our project requirements by pressing a button, we should do it. If this button does not exist, we must write code.
The temptation of all developers is to redesign systems with no concrete payoff. This is because developers are clever and enjoy building things.
The skill of developing software therefore lies in the code we don’t write.
2. Time Is A Limited Resource
In the game of software development, time is the most limited resource. If we had infinite time, we could build all our own custom libraries and frameworks, thoroughly test everything by hand, and ensure near perfect quality with zero dependencies.
We can sometimes exchange work for time. Automated tests save us the time of manually testing, at the cost of writing and maintaining the tests. Refactoring will save us the time of working around troublesome code later, at the cost of refactoring the code.
It would appear that we could add time by adding people. But adding additional developers to the project does not simply multiply the amount of time, as each additional developer adds an overhead cost to future work.
All work we choose to do is also a choice not to do other work.
3. Dependencies Both Decrease and Increase Work
All systems have dependencies. Adding dependencies can both erase current work and create future work. So we must be careful about dependencies.
Dependencies are bad if they increase the net amount of work required over the life of the project. Dependencies are good if they decrease net work.
Adding a dependency often saves time in the short term, but costs more in the long term.
Developers are a kind of dependency.
4. Laziness Is Good
The statement “laziness is good” is intended to shock the mind out of its preconceived notions.
Each of us is a self-interested player in the game we call software development. The best possible outcome is achieved if everyone in this game acts in a way to minimize work.
We call the self-interested drive toward work minimization “laziness.” It is the primary virtue.
Paradoxically, laziness may result in us doing work. That work, however, must erase other work so that the net amount of work is minimized.
5. Unnecessary Work Is Evil
As the opposite of the virtue of laziness, doing extra work is the primary evil.
Doing work costs time. Time is a limited resource. Even if we can add some time, we can not do so freely at no cost.
We should spend time doing work if and only if it decreases the total work left to complete the project.
Any work that does not meet this criteria is unnecessary work.
Unnecessary work should not be done.
~ FIN ~