Ordinarily these posts are made to announce progress in Bash++’s development. Briefly: a major refactor is underway with the goal of adding an optimizer to the compiler; this will form the basis for a new v0.9 series. If you’re interested, the current state can be seen in the exp-optimizer branch of the Bash++ repository.

This post, however, comes from some recent discussions I’ve had with friends and colleagues about engineering. It’s an attempt to explain what I consider to be an ideal in systems design, although I want to preface it by saying that I’m fairly confident that I’ve never once succeeded in achieving this ideal. It remains a guidepost for me anyway.

Cognitive Axiomatics

All system designs (not only in software, but particularly in software) should strive for this, but very few can be expected to meet it: they should be underpinned by a formal system where the a priori rules are constructed specifically to justify the user’s a posteriori gut feeling.

We design the cognitive UI first, and then derive the minimal set of axioms required to make that UI universally infallible.

This is an attempt to reverse-engineer formal logic from human instinct.

Many system design patterns move in this way: we begin with a beautiful core calculus, and add surface-level interfaces (such as syntactic sugar) to permit the user to interact with it.

This philosophy is an attempt to invert the approach. We begin with the subconscious (unthinking) interaction and treat the user’s instinct as a formal requirement. We work backwards to derive the smallest set of axioms that, when applied universally, inevitably produce the expected outcome.

However, minimization of the rule-set is not the only criterion. Specifically, a design is “elegant” when each of its rules are strictly necessary in order to rescue the user’s intuition from being wrong. If an intuition can’t be justified without breaking the internal logic of the system, this intuition is permitted to rewrite the rule-set.

This gives us a straightforward filter for proposed features:

  1. Assume a tired & distracted expert. What would they assume happens in this case?
  2. What is the smallest change to our current set of axioms that turns that intuition into a mathematically inevitable consequence in all cases?

If we find no such change without adding a special-case exception, we should (at the very least) hesitate to add the exception. Ideally, refactor the axiom set until the intuition is a natural corollary. This makes logical beauty and internal consistency a goal for the system’s design. And conversely, if a proposed rule is “elegant” but doesn’t directly serve to justify the user’s expectation, this rule should be discarded. This means that beauty without cognitive grounding is architectural noise.

Whose intuition?

This is the core question. It can’t be answered by assuming that all users share the same expectation. It may even be inherently unanswerable.

A map is not the territory it represents, but, if correct, it has a similar structure to the territory, which accounts for its usefulness.

— Alfred Korzybski, A Non-Aristotelian System and Its Necessity for Rigour in Mathematics and Physics (1931)

An expert’s intuition is effectively a compressed model of the system. If that model routinely predicts the wrong outcome, then the system is imposing a cognitive tax on the user.

The real goal is that it must be possible to construct such a coherent (and useful) compressed model. In real (read: large) systems, this means that the architecture of the system creates a set of possible states which form a strict superset of those states represented in the expert’s intuitive mental model. Unthinking interaction is then sufficient for use, and even for advanced use, and deliberate study generalizes the user’s experience to a more complete view of the system.

This is analogous to the study of Newtonian mechanics, where many of the physical intuitions of the student are elaborated with new precision and generalized to universal principles: very little of the student’s experience is contradicted, and new insights are gained. In an ideal system, absolutely none of the student’s experience should be contradicted by rigorous study of the system’s formal rules, but of course this is nearly impossible in practice.

In a single question

Ask: what entities and relationships would have to exist for the user’s natural interpretation to be actually true?