Budgeting Code

“My point today is that, if we wish to count lines of code, we should not regard them as ‘lines produced’ but as ‘lines spent’: the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger.”

E.W. Dijkstra

Ever written a lot of code and discovered you didn’t have enough time left to turn it into good code? Maybe you cranked out ten thousand lines in the first month of a three-month project and then realized that two months isn’t enough time to test and debug ten thousand lines of code. It’s probably not even enough time to explain the purpose of ten thousand lines to a user and confirm that you’ve understood their needs correctly.

You blew your code budget.

Writing code costs a lot less time than all the other things you need to do to it after it’s written, so you have to be careful not to write more than you can afford.

If you had a code budgeter like Jest, you would have: