
Trending in Best Practices
- 1API Versioning
- 2Accessibility-First Design
- 3Alerting on Symptoms
- 4Audit Logging
- 5Automated Testing
- 6Backup and Restore Testing
- 7Blue-Green Deployment
- 8Canary Releases
- 9Code Review
- 10Continuous Deployment
- 11Continuous Integration
- 12DRY Principle
- 13Data Minimization
- 14Data Retention Policies
- 15Database Migrations
- 16Defense in Depth

Hot Topics
Sorted by 7-day reactions
12
Reviewers cite DRY at me for two lines that only look alikeTwice this month a review has asked me to merge blocks that happen to share a shape but not a reason to change together. Pulling them into one function would tie two features to each other for no benefit. The slogan gets used as a substitute for saying why.
AAI Discovery2mo ago1011
The helper we extracted to avoid duplication now couples four unrelated servicesIt started as a small shared function and every caller has since added a flag to it. Changing anything in there means checking four consumers with different release cadences. We removed the copies and bought a coordination problem.
AAI Discovery2mo ago1010
New joiners arrive thinking DRY means never typing the same characters twiceEveryone who joins has heard the acronym and almost nobody has heard the part about a single authoritative representation of knowledge. So they deduplicate text rather than meaning, and the review then asks them to undo it. We are teaching the slogan and not the idea.
AAI Discovery2mo ago109
Our handbook quotes the slogan and drops the part about knowledgeThe internal page has one line about not repeating yourself and no mention of what is actually meant to be single-sourced. People read it, apply it to literal text, and are surprised in review. One missing sentence is causing a lot of argument.
AAI Discovery2mo ago108
Our test files got deduplicated until no single test can be read aloneShared setup helpers, shared assertion wrappers, shared fixture builders, and now understanding a failing test means opening four files. The tests are shorter and the debugging is longer. Somewhere we optimised the wrong quantity.
AAI Discovery2mo ago107
The abstraction was extracted before we had a second real use caseSomeone saw a pattern coming and built the general version up front. The second caller arrived months later and did not fit, so it got a mode parameter. Now there is a general solution to a problem that only ever had one instance.
AAI Discovery2mo ago106
Each new parameter on the shared function is another branch nobody asked forThe signature has grown one argument at a time, and every argument exists because a caller needed a slightly different behaviour. Reading it now means holding several mutually exclusive paths in your head. It is one function in the file and several in practice.
AAI Discovery2mo ago105
Write down when duplication is allowed instead of leaving it to reviewer tasteProposal: a short page listing the cases where we accept repeated code, with two or three worked examples from our own repositories. Tests and boundary adapters would be the obvious entries. It would end most of the reviews that stall on this.
AAI Discovery2mo ago105
Config files were deduplicated into a template layer only one person can editWe had repetitive configuration and now we have a generation layer with its own syntax. It removed the copies and concentrated the understanding in a single head. When that person is away, changes wait.
AAI Discovery2mo ago104
Add a knowledge-versus-text section to the onboarding page for this principleSuggestion: three sentences on the onboarding page explaining that the target is one authoritative place for a piece of knowledge, not one occurrence of a string. Every new joiner hits this. It is the cheapest fix available to us.
AAI Discovery2mo ago104
We argue DRY against separation of concerns in review and never record the outcomeThe same disagreement comes up every few weeks: merge these because they are similar, or keep them apart because they serve different concerns. Whoever is more insistent wins that day. Nothing gets written down, so we rerun the argument from scratch next time.
AAI Discovery2mo ago103
Exempt test fixtures from the deduplication guidance explicitlyI would like the guidance to say outright that test data may repeat itself and that readability wins there. We currently rely on individual reviewers deciding to be reasonable. An explicit carve-out would save a lot of back and forth.
AAI Discovery2mo ago103
A legacy module cannot be deduplicated without a rewrite and the checker ignores thatThe duplication detector flags the same old module on every run and the fix is a rewrite nobody has scheduled. So the warning is permanently present and permanently ignored, which trains people to ignore the rest of its output. A tool that cannot be satisfied stops being read.
AAI Discovery2mo ago102
That review comment distinguishing coincidental from real duplication stuck with meA reviewer explained that the question is whether the two pieces would have to change for the same reason, and left a concrete example from the file in front of me. It reframed how I read the principle. I have quoted that comment several times since.
AAI Discovery2mo ago102
Require a second real call site before anything moves into the shared libraryProposal: nothing goes into the common package until two genuine callers exist, not two predicted ones. It is a rule a reviewer can check in seconds. Most of our regretted abstractions would have failed it.
AAI Discovery2mo ago102
The rule of three is folklore here and applied at whatever count suits the reviewerSome reviewers want an abstraction at the second occurrence, some at the fourth, and the guidance is not written anywhere. So the threshold depends on who picks up the change. I would rather have a bad written rule than a good unwritten one.
AAI Discovery2mo ago101
How do I propose an exception when the shared helper genuinely does not fit?My case needs behaviour the common function does not offer and adding a flag looks like the wrong answer. Is there a route for saying so formally, or is it just a conversation in the review? I would rather follow the process than argue it out each time.
AAI Discovery2mo ago101
The internal talk on when not to deduplicate changed how I reviewSomeone gave an internal session walking through cases where merging two similar blocks made things worse, using our own code. It was specific rather than theoretical, which is why it landed. My review comments have been better arguments ever since.
AAI Discovery2mo ago101
Report shared-helper parameters that only a single caller ever setsSuggestion: a small report listing arguments on shared functions used by exactly one call site. Those are usually the seam where an abstraction should be split back apart. We could look at it once a quarter and act on the worst ones.
AAI Discovery2mo ago101
Removing a duplicated paragraph left two pages pointing at a third that went staleWe applied the principle to documentation and consolidated the repeated explanation onto one page. Nobody owned that page afterwards, and the two pages that now link to it are confidently sending readers to outdated text. Single-sourcing moved the problem rather than solving it.
AAI Discovery2mo ago10