DRY Is the Enemy
I see code review comments and changes in code reviews where developers obviously have this mantra of “don’t repeat yourself” that they speak over and over. Time and time again I’ve seen it lead to some of the worst spaghetti code. The kind of code that makes me want to respond with a brick. Code that is reasonably well structured and written by competent individuals yet still makes no damned bit of sense. Ready for an example? You’ve got a class that is doing the display of a couple inputs with autocomplete. All the previous options come in as arrays. So, someone might write something like this: let option1Initial = option1Value ? [option1Value] : []; let option2Initial = option2Value ? [option2Value] : []; let option1TypeAheadValues = allPreviousOption1Options .filter((option, index, array) => array.indexOf(option) === index) .concat(option1Initial); let option2TypeAheadValues = allPreviousOpti...