← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

Rethinking Reusable Components: When Duplication Outweighs Premature Abstraction

🔄 Updated 1d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Premature abstraction increases coding and coordination costs.
  • Duplication is easier to remove than a wrong abstraction.
  • Surface-level similarities can hide fundamental workflow differences.
  • Overly generic components become complex with flags and exceptions.

The Pitfalls of Premature Reusability

The common advice in frontend development is to create reusable components by abstracting similar screens. However, this article posits that sometimes it is better to delay this process. Creating an abstracted component incurs higher coding and coordination costs, and a wrong abstraction can be more expensive to undo than simply removing duplicated code.

A Case Study: One Component, Three Workflows

The author recounts an experience with three distinct workflows: item approval, item change, and item movement. Despite their interfaces appearing similar (item list, select, confirm, results), the underlying processes had critical differences. These included how they handled partial failures, specific requirements, and auditing needs. For instance, item relocation involved another system that could reject requests, a factor not present in the other workflows.

The Cost of Over-Generalization

Initially, the decision was made to create a single component due to the perceived similarities. This led to a component that grew in complexity, incorporating numerous flags and modes (e.g., 'mode', 'variant', 'showDetails', 'requireReason', 'onSpecialCase') to accommodate the distinct behaviors of each workflow. This approach resulted in a component with multiple submission paths and error shapes, indicating that the initial abstraction was flawed because it did not account for the deeper functional divergences.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

This article argues against immediate creation of reusable components, suggesting that premature abstraction can lead to higher costs and complexity than initial code duplication. It highlights a case where surface-level similarities between three workflows led to a single, overly complex component that failed to account for distinct underlying requirements and failure modes.