skip to content

The Boy Scout Rule is Dying

/ 2 min read

Always leave the code a little better than you found it.

First make the change easy, then make the easy change.

For a generation of programmers, these were the words to live by. You wouldn’t keep refactoring everything of course, but if you touched a file to fix a bug, you’d also clean up the nearby mess, tidy a misleading variable name, break up a large function, delete an outdated comment. This kept the codebase from decaying.

If you encountered a tangled, incomprehensible function, updating it was painful. You had to sit for hours tracing through the code flow, keeping a dozen things in your head, building a mental model just to make few lines of changes. But this pain was a useful signal, it screamed “REFACTOR ME!”. It also enforced taste as you learned how to do things better the next time around.

AI lowered that pain. The default now is to simply prompt to add a new thing or fix a bug. You don’t have to build an “understanding” to ship new changes. Change made are also usually rational locally, and bad code becomes way more tolerable.

But tolerable code accumulates and compounds. The nested conditionals gets another layer of nested conditionals within. The variable that used to mean one thing takes on five new meanings. Modules start to couple in subtle ways. And shipping slows down, with even the AI tripping over the mess.

There is a question of if it’s a problem we should think about at all, as eventually it wouldn’t matter with more powerful models. But in the moment, it does matter a lot. And I think it’ll matter for near future as well, though the unit of abstraction will go up.