top | item 37311775

(no title)

49531 | 2 years ago

I think mislabeling something as a duplication is where most of these issues stem from.

Humans love to pattern match, we find patterns in things that often have no real pattern. It is not uncommon in my experience to see patterns in code, label the code as not DRY, and attempt to DRY it up. If the "duplication" detected was, in fact, not a duplication but rather code that just happens to be similar, the abstraction will often go awry.

My rule-of-thumb is to prioritize maintenance over authorship. Am I writing this code in a way that makes it easier for future me or another programmer to change it, or am I optimizing for a sleek diff in my code review? I think our code can look like breadboards instead of a bespoke printed circuit board, we have compilers for that.

discuss

order

No comments yet.