Comment

Comment by 49531

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.

parent 49531 3 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton