The cost of opinion
Frameworks and libraries are like layers,
and these layers accrete.Every layer has a vector of intention,
pointing toward some idealized value to users,
determined by the author of the layer.Opinion,
or the difference
between the vectors of intention of two adjacent layers,
always comes at a cost.Opinion costs compound
and are, directly or indirectly,
shouldered by users.
An intriguing post where the author tries to explain his intuition about whether a framework is “good”.
Every framework and library [takes] the “what is” of the underlying platform (or layer) and [transforms] them to produce the “what should be”: it’s own APIs. For example, jQuery took the dizzying variety of ways to find a DOM element across different browsers back then (the “what is”) and produced the now-ubiquitous “$()” function (the “what should be”).
There are costs to the opinions in frameworks.
The cost is proportional to the degree of opinion. For example, if I decided to build a Javascript framework that completely reimagined UI rendering as graphs or three-dimensional octagonal lattices rather than trees, I would quickly find myself having to reinvent the universe. The resulting artifact will weigh some megabytes and consume some kilowatts, with DOM trees still impishly leaking out of my pristine abstractions here and there, necessitating tooling and various other aids to ensure successful launches of user experiences, built using my awesome framework.
What’s even more alarming is that opinion costs have a tendency to compound. Should developers find my framework appealing, I will see more high-profile sites adopting it, causing more developers to use it, extend on top of it, and so on. The outcome of this compounding loop is that users will find more of their computing resources drawn to chew on my opinions.
Frameworks abstractions should aim to trickle down to the platform. If they don’t, they become more expensive. And that cost compounds the more popular the library diverges from the underlying web platform.
Design of the platform primitives matters, because it establishes the opinion cost structure for the entire developer ecosystem.
This is where so much friction exists, I think, between “components” and “web components”.
The opinion often comes across as treating the underlying platform as hostile, using as little of it as possible — which unfortunately, is sometimes necessary to make something that actually works.