The Hidden Cost of Doing Work in the Wrong Place

Jaeyeol Lee

Hatched by Jaeyeol Lee

Jun 09, 2026

10 min read

91%

0

The real problem is not too much code, it is misplaced code

Most teams do not fail because they write bad logic. They fail because they put good logic in the wrong place.

A calculation that should happen while rendering gets moved into an Effect. A user response that should happen inside an event handler gets delayed into some lifecycle machinery. A layout issue that should be solved with hierarchy gets patched with more styling. A product signal that should be visible at a glance gets buried in a flat interface. In each case, the work itself may be correct, but the location is wrong, and the result is friction.

That is the deeper connection between frontend architecture and interface design: clarity comes from placement. The question is not only what the system does. It is where each piece of work belongs so that the user, the codebase, and the team all stay in sync.

The best systems do not merely contain the right parts. They place each part where it can do the least harm and the most good.

This is why some interfaces feel instantly legible while others feel busy, slow, and fragile. It is also why some codebases become easy to extend while others turn into a maze of timing bugs and duplicated logic. Both problems often come from the same mistake: treating all work as if it belongs in one generic place.

Effects, hierarchy, and contrast are the same design problem in different clothes

In user interfaces, contrast is not decoration. It is a form of information architecture. A bold button, a subtle label, spacing between groups, and clear feedback after an action all tell the user where to look and what matters now. The same logic applies to application code. A render is for deriving what the screen should look like. An event handler is for responding to an intentional action. An Effect is for synchronizing with the outside world when the screen is visible.

That division is not arbitrary. It mirrors how humans understand systems. We naturally distinguish between a thing that is true right now, a thing that just happened, and a thing that must keep pace with reality. If you blur those categories, the software still runs, but it becomes harder to reason about. If you blur those categories in design, the page still displays, but users have to work harder to understand it.

Consider a search page. The current query and page number determine what should be shown. If the component is visible, it should stay synchronized with the network result for that query and page. That is an Effect because the component is participating in an ongoing relationship with the outside world. But if the user clicks a filter, that change belongs in the event handler because it is a direct response to a discrete action. And if you need to turn raw data into a display label, that belongs in rendering because nothing external is being synchronized.

The same separation appears in design hierarchy. A form with no visual grouping forces the user to infer structure from memory. A page with weak contrast forces the user to inspect everything equally, which means nothing stands out. A well designed interface groups related elements, emphasizes the primary action, and provides immediate feedback for changes. In code, the equivalent is keeping each kind of work in its proper place so the meaning of the program stays visible.

This is the larger insight: architecture is a hierarchy of responsibilities. Once you see that, the usual frontend debates start to look different. The problem is not whether a task is small or large. The problem is whether it belongs to the moment of rendering, the moment of interaction, or the moment of synchronization.


When work is in the wrong place, the symptoms look unrelated but the cause is the same

A misplaced Effect often does not fail loudly. It fails gently, with just enough noise to become normal. You fetch data after every render because the logic lives in the wrong lifecycle. You introduce race conditions because two requests are allowed to compete for the same state. You split one simple transformation into multiple steps because some of it happens during rendering and some of it happens later. The result is not only slower code. It is code that no longer tells a coherent story.

Design has the same failure mode. A weak contrast ratio makes important information blend into the background. Poor alignment makes the eye wander without confidence. Inadequate feedback on a form leaves users guessing whether their input was accepted. These are not separate visual sins. They are all examples of information arriving in the wrong shape, at the wrong time, or in the wrong place.

Take a concrete example. Imagine an order form that calculates shipping costs, validates an address, and updates the page title after each keystroke. If all of that is lumped into Effects, the app may seem “reactive,” but it becomes fragile. A user types fast, requests race, stale values arrive late, and the UI flashes contradictory states. If the form instead keeps local calculation in rendering, handles explicit user actions in handlers, and uses an Effect only to synchronize with external services, the behavior becomes much easier to predict.

The interface side works the same way. If every field in the form looks equally important, the user cannot tell where to begin. If validation messages appear without visual grouping, they feel random. If the submit button does not contrast enough, the action does not feel real. A good form does not just validate data. It stages attention.

This is where frontend engineers become unusually valuable. They sit at the junction of design intent and technical constraint. They know that a certain animation may be expensive, that a blend mode may compromise readability, that a component library can enforce consistency, and that some scenarios can only be confirmed after launch through metrics. In other words, they can judge not only whether something works, but whether it belongs where it was placed.

Most UX bugs are really placement bugs: a signal hidden, a response delayed, or a responsibility routed through the wrong channel.

That is why design systems matter more than style guides. A design system does not merely standardize colors and spacing. It creates a shared vocabulary for placement. It tells the team which blocks can be reused, how they fit together, and what kinds of variation are acceptable. In code, that same discipline reduces the temptation to improvise with Effects whenever logic feels inconvenient.

A useful mental model: three layers of work

If you want a practical way to unify these ideas, use this model:

1. State of the world

This is what must remain true while the component is visible. Examples include network results for the current query, the current form values, or the active step in a flow. If the component needs to stay aligned with something outside itself, this is synchronization territory.

2. Moment of intent

This is the user’s explicit action. Clicking, typing, submitting, expanding, selecting. Work triggered by intent should stay close to the event that caused it. That preserves causality, which is one of the most important ingredients in understandable software.

3. Shape of meaning

This is the visual and structural interpretation of the state. Contrast, hierarchy, alignment, grouping, and feedback all belong here. The job is not merely to display data, but to make the data readable as meaning.

These layers map cleanly onto the common frontend mistakes. When you put derived data into Effects, you confuse shape of meaning with state of the world. When you handle a click indirectly in an Effect, you confuse intent with synchronization. When you flatten the layout, you erase the visual hierarchy that would have made the state legible.

Think of a library catalog. The books, the checkout system, and the signs are different kinds of work. Books must exist. Checkout must react to patron actions. Signs must organize attention. If you use checkout software to organize the shelves, or use shelf labels to run the lending system, chaos follows. Software interfaces are no different.

This model also explains why some problems are solved by subtraction rather than addition. Removing an unnecessary Effect often improves speed, but more importantly, it restores causal order. Tightening contrast often improves aesthetics, but more importantly, it restores perceptual order. A cleaner design or simpler component is not merely prettier. It is easier for reality to pass through.

The deeper thesis: good frontend work is about preserving causality

The most powerful unifying idea here is that frontend quality depends on preserving causality.

Causality means the user can understand what happened, why it happened, and what will happen next. In code, causality means the logic is aligned with the kind of event that triggered it. In design, causality means the eye can trace a path through the interface without confusion. In team workflow, causality means designers, frontend engineers, and backend engineers can all see how their decisions affect the final product.

When causality is preserved, systems feel responsive without being noisy. A render is pure, because it describes what is true now. An event handler is direct, because it responds to a user. An Effect is reserved, because it connects the component to something outside itself. On the visual side, contrast marks importance, hierarchy organizes attention, and feedback closes the loop after an action.

When causality is broken, systems become theatrical. They look reactive, but they are actually delayed. They look polished, but they are actually ambiguous. They look modular, but they are actually full of hidden dependencies. The user experiences this as hesitation, surprise, or uncertainty. The engineer experiences it as bugs that are hard to reproduce. The team experiences it as maintenance cost.

This is why the best frontend work often feels invisible. Not because it lacks craft, but because it removes friction between intent and outcome. The user does something, the interface answers immediately, and the visual structure makes the answer obvious. The code does something, the logic stays local, and the state changes can be traced without detective work.

That invisibility is not an accident. It is the result of making hard distinctions and respecting them.

Key Takeaways

  1. Ask where the work belongs before asking how to implement it. Decide whether something is rendering, user intent, or synchronization with the outside world.

  2. Use contrast and hierarchy as signals, not decoration. If users cannot immediately see what matters, the interface is doing work in the wrong place.

  3. Keep causality local. Put action logic in event handlers, derived values in rendering, and external synchronization in Effects.

  4. Treat design systems as placement systems. They are not just style rules, they are a shared map for how interface parts should behave together.

  5. Watch for symptoms of misplaced work. Race conditions, stale updates, weak form feedback, poor alignment, and visual ambiguity often share the same root cause.

The real craft is not adding more intelligence, it is assigning it correctly

It is tempting to think that better software comes from adding more logic, more polish, more automation, or more visual effects. Often the opposite is true. Better software comes from deciding where intelligence should live. Some intelligence belongs in the render, because the answer is a pure function of state. Some belongs in an event, because the user has just revealed intent. Some belongs in an Effect, because the component must stay in conversation with the outside world. Some belongs in the layout, because the eye needs structure before it can interpret meaning.

That is the hidden common denominator between robust frontend code and thoughtful interface design. Both are acts of placement. Both ask the same question in different languages: what should be immediate, what should be visible, and what should be synchronized?

Once you start asking that question, many familiar recommendations stop sounding like isolated best practices. Avoid unnecessary Effects. Use clear contrast. Group related elements. Provide feedback. Maintain alignment. Build with a design system. Validate scenarios. These are not separate tips. They are all expressions of one discipline: make each kind of work happen where it can be understood.

And that is the lasting reframing. Good frontend engineering is not just about making screens and states work. It is about designing a system in which work itself is legible. When placement is right, the app feels calm, the code feels honest, and the team can move faster without creating hidden debt.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣