Technology1 min read

Don’t Build the Reusable Component Yet

By · Published by Everything Blog

In short

Engineering teams often rush to consolidate similar interfaces, but premature abstractions introduce severe maintenance bottlenecks and coordination friction. Surface-level visual patterns frequently conceal conflicting requirements, such as divergent failure handling and auditing logic, which complicate future updates. Allowing implementations to evolve separately prevents codebases from accumulating fragile exceptions that disrupt multiple workflows. Attempting to force shared abstractions often results in components laden with custom modes and flags that require cross-team negotiations for even minor adjustments.

Key points

  • Developers should allow separate screens to develop independently instead of rushing to a…: Developers should allow separate screens to develop independently instead of rushing to abstract them.
  • Teams should delay building a shared abstraction until a specific pattern repeats three t…: Teams should delay building a shared abstraction until a specific pattern repeats three times.
  • Code should only share an abstraction if a single decision alters both instances simultan…: Code should only share an abstraction if a single decision alters both instances simultaneously.

Sources checked by our analysis pipeline: 1

Everyone who ever worked in frontend knows what kind of advice they are going to receive: to make things reusable. Find similar screens, create an abstracted component. Now, enjoy the little pleasure of deleting extra code. However, sometimes there are cases when I would like to say the exact opposite of this, for a short period of time, at least. Not only does the creation of an abstracted component mean higher costs of coding but also higher costs of coordination.

Duplication can easily be removed, but a wrong abstraction can be expensive to undo.

The case: one component, three workflows

In old days, there were three workflows, where I had to perform an “item action,” which consisted of workflow approval ("Do you really need this item?"), workflow change ("Change item's settings"), and workflow movement ("Move item from/to managed area").

There was nothing unusual about the interface for these actions – item list, select, confirm, and show the results. Same tables, pop-ups, and toasts. It just seemed ridiculous to create three almost identical actions; so, I decided to create only one.

Technology