design-patterns

  • The command bus we removed

    A command bus introduced in 2021, and 88 commands with one handler each. A stack trace with four frames of dispatch before the work.

  • Equality on a type where identity was ambiguous

    A value object where two instances with the same fields might or might not be the same thing, and five years of nobody deciding. The ambiguity is in…

  • The value object library, five years on

    32 value objects in 2021, 41 now, and a retrospective on which of them earned their place. No symptom — a deliberate look.

  • Layout primitives, documented for the first time

    Four hundred lines of layout code that one person could read, described in a page. These had been written in 2021, worked perfectly and were opaque — the…

  • A value object with no invariant, deleted

    Eight single-property wrappers over a string, none of which validated anything. A value object with no invariant is a type alias that PHP does not have, and the…

  • The stylesheet that finally got a second maintainer

    2,100 lines that one person could change, and the year spent fixing that. Every stylesheet change routed through one person for four years.

  • Writing a PHPUnit extension

    turkerdev/phpunit-json-coverage-report, and a coverage report a machine can read. Coverage as a percentage in a log, and no way to ask which paths changed.

  • A readonly class that survived a requirements change

    A value object made readonly in 2022, and the requirement in 2026 that would have broken a mutable one. The property that mattered was not thread safety or…

  • A year of property hooks, and the three I would not write again

    218 methods became properties in December 2024, and a year of living with a syntax that hides work.

  • Container queries on a component with two placements

    A card written in 2023 with two layout branches, of which one had never rendered until January. A branch that has never executed has never been verified, and…