Re:“What if it changes?”
by woolion on Monday May 23, 2022 @06:14AM
(#31477120)
I also got this heuristic from Martin Crawford.
However I believe it applies to snippets (<100 lines of code at the very most) only, for the reason you gave.
But even then, it sometimes happen that you find a bug in a 4 line snippet that you know was duplicated once, and have to hope you can find it through grep or commit history. So while being careful not to over-engineer and apply KISS/YAGNI ('you ain't gonna need it'), one-time duplication can be a pain.
[ Parent
| on HN ]
I cannot edit my comment anymore, but I realized Crawford is the Martin of 'Forest Garden' fame. I was obviously meaning Martin Fowler, from the 'Refactoring' book.
Maybe we'll have 'Forest Software' in some time. 'A code forest is an ecosystem where the population of bugs, slugs, trees and weed balance themselves, requiring very little input from the engineer'.