It's true. I know it's not always a comfortable truth, especially for those managers who like to measure achievement in lines of code. But it is true.
The best solution? Re-use existing code.
The most satisfying refactor? Less code than you started with.
The easiest bugs? Scoped in the least code.
All Code Is Evil. As someone paid to create it that isn't so good. Unless you're paid to be smart and only create as much new code as you need to to solve the problem at hand.
All Code Is Evil. The more I have dwelt on this simple premise, the more sense it has made. The more other coding advice seems to fit with it: You Aren't Going To Need It so don't write it because it's Evil! Don't Repeat Yourself that's doubly Evil! Test Driven Development you can't trust that Evil code to do what you think it does!
So remember: All Code Is Evil
I found this post by whimsically searching Google for the phrase "satisfying refactor". For a two-word phrase there are very few results, which I found satisfying in and of itself.
ReplyDeleteEnjoying your blog immensely, and hope you keep it up :)
Thanks!
DeleteI must say I'm both surprised and perhaps slightly saddened by how few results there are for "Satisfying refactor". There must be plenty of satisfying refactorings going on every day.