News for hackers. Stuff that matters.
Re:Show HN: CLI tool for detecting non-exact code duplicatio... by rufius on Thursday July 02, 2026 @01:39PM (#48764849)
(without sarcasm) Is this a serious question?

If so - maintainability, testability. This is old software engineering best practice at this point.

You shouldn’t hyper optimize for deduplication, but it’s usually worth considering. Fewer places to fix issues or improve as well.

Re:Show HN: CLI tool for detecting non-exact code duplicatio... by klibertp on Thursday July 02, 2026 @02:02PM (#48765190)
I tend to follow the "rule of 3": a second similar implementation is OK, introducing the third triggers a refactor. As with everything, this isn't dogma, and sometimes the second implementation is already too much, while at other times you get tens of similar code sections (in codegen, repeating patterns with almost no changes is a virtue). But it's a good rule of thumb.

On testability: two implementations can be tested against each other, leading to greater coverage with less test code. It doesn't work that way for 3+ implementations, which is another reason not to have that many.

Re:Show HN: CLI tool for detecting non-exact code duplicatio... by SpyCoder77 on Friday July 03, 2026 @12:40PM (#48777005)
I seem to have misunderstood. I thought that it was talking about stuff like similar repos, but now I realize that this is most likely talking about a singular codebase