refactoring

  • The service class that was three procedures

    A class named for a noun, containing three methods that share no state and call nothing in common. A class whose methods share no dependencies is a namespace…

  • Reading a codebase in a language I do not write

    A supplier’s open source client library, read to answer one question, without learning the language first. Reading unfamiliar code for one specific question is a different and more…

  • A package I published, and the API design I got wrong twice

    turkerdev/php-figma-api, a typed client for a third-party REST API, and two design mistakes that only appear once somebody else uses it.

  • Terraform 1.11, and a plan I could finally read

    A plan output that had grown to four hundred lines for a two-resource change, mostly from a provider that reports every computed attribute. The JSON plan has been…

  • A decision record for something we did not do

    A record of a rejected proposal, which is the kind nobody writes and the kind that saves the most time. The same proposal arriving twice in two years…

  • An index added for a query that was deleted a month later

    An index created for a reporting query, and the report replaced by a projection four weeks afterwards. An index nobody reads costs write throughput and buffer pool on…

  • 188 tests deleted with the code they covered

    A directory of tests excluded from every tool since 2023, examined and removed along with what they tested. Three independent checks — coverage to find what the tests…

  • The recursion that needed a stack instead

    A category tree walker that recursed to a depth of eleven in development and to two hundred in production, on data nobody had constrained. The production data had…

  • array_find on a collection that should have been indexed

    Replacing a foreach with array_find made the code shorter and left the actual problem in place. A new function makes a linear scan pleasant to write, which is…

  • A prototype branch deleted after a decision

    A branch with a working framework migration on one component, kept for six weeks and then deleted on purpose. A prototype whose conclusions are recorded is finished, and…