Blog · Craft · · 2 min read
Neither MIT nor New Jersey
Richard Gabriel's classic essay Worse is Better framed software design as a choice between two schools. The MIT approach fixes a complete, consistent interface first and lets the implementation absorb whatever complexity that demands. The New Jersey approach fixes implementation simplicity first and lets the interface carry the rough edges.
Both schools make the same mistake: they hold one side fixed and make the other side pay.
Co-optimizing interface and code
Ptree works from a third position. Neither the visual interface nor the underlying code is treated as a frozen spec; both move together until they settle into a joint minimum where their simplicity reinforces each other.
In practice that means two things that feel unnatural in conventional product teams:
- The interface is allowed to yield to the code. If a native CSS transition or a simpler layout law produces a cleaner interaction than what you first imagined, adopt the cleaner interaction instead of simulating the first sketch in JavaScript.
- A feature is judged by what it does to the architecture. Asking "can the code become more invariant, simpler, and more decoupled by adding this feature?" catches bad cuts before they ship.
This is why bug reports on Ptree frequently become design questions. If a visual tweak requires a wrapper <div>, an exception list, or a JavaScript coordinate sync, that friction shows that the visible design and the underlying model disagree.
The right shape has no exceptions
A structural distinction with no visible purpose is dead weight; a visual exception with no structural distinction is a bug in the model. When the two line up, both sides compress at once:
- Every property key in Ptree's legend sits in the same
1 / 1CSS grid cell and slides via one registered--kinumber. The visible carousel and the automatic intrinsic height are the same rule. - Both categorical and numeric filters share one URL grammar (
key:a|bandkey:lo..hi), one popover list, and one.Filteringclass on<body>. The interface teaches one mental model because there is only one mechanism underneath. - Three views (Tree, Icicle, Cladogram) share one sticky column header and one tile grammar instead of maintaining three parallel DOM arrangements.
- Switching between scientific and common names does not rebuild DOM text or crossfade two different strings on top of each other (which ghosts). Both spans live permanently inside the same grid cell; toggling
.Commonon<body>staggers their opacities by half the transition clock so the leaving name clears before the arriving name fades in. - In the numeric legend, a single measured species (
count === 1) does not morph a vertical median bar into a diamond in JavaScript. Two separate primitives share the same--medcustom property and simply crossfade opacity when.pointtoggles, keeping both the visual transition and the CSS rule trivial.
When either the interface or the implementation needs an exception to satisfy the other, the search is not finished. Keep moving both sides until each becomes the simplest explanation of the other.