|
|
|
|
|
by nevinera
754 days ago
|
|
DRY is _not a best practice_. Repetition is a "code smell" - it often suggests a missing abstraction that would allow for code reuse (what sort of abstraction depends on the language and context), but "blindly-drying" is in my experience the _single most frequent mistake_ made my mid-to-senior engineers. My experience is mostly in Ruby though, so I'm not sure how well it generalizes here :-) |
|
Right. It's not an optimization problem!
Remember in school when you learned to turn a truth table into a Karnaugh map and then use it to find the smallest equivalent logic expression? Well, your code is not a Karnaugh map, is it?