Skip to catalogue

58

leaky abstraction

The wrapper still forces you to know what is underneath. Then it is not a wrapper.

What is leaky abstraction?

A leaky abstraction hides a system but lets its accidents through: SQL errors in the UI, HTTP status codes in the domain, a “repository” that returns the ORM row.

Why does leaky abstraction matter when vibe coding?

Models love a `utils` layer that re-exports the library with the same arguments. You paid for an abstraction and still have to know Stripe’s error shape. Name the leak.

How do you do leaky abstraction?

At each boundary, map to your nouns. The UI sees “payment failed,” not `card_declined`. If the caller must know the inner type, the abstraction failed.

How do you ask a model for leaky abstraction?

Do not leak (library) types past this boundary. Map errors and rows to our types. Callers must not import the SDK.

What goes wrong with leaky abstraction?

Wrapping every call in `try/catch` that rethrows the same error. That is a costume.

adjacent