Uncategorized

  • nginx HTTP/2 server push, and why it disappoints

    HTTP/2 push lets the server send a resource before the browser asks, which sounds like it should remove a round trip and in practice often sends something the…

  • The consumer decides what it needs, not the publisher

    A publisher asked to add a field for one consumer will add it, and after five of those the event is a shared schema that nobody can change.…

  • Object.entries and Object.values, finally

    Iterating an object has meant Object.keys() and an index lookup, which names the key twice and reads badly next to the array methods it sits beside. Both return…

  • Multi-catch for two exceptions with one handler

    Handling two unrelated exceptions the same way meant either duplicating the catch block or introducing a common interface for the sole purpose of catching them together. The variable…

  • An array shape annotation the analyser understands

    A function returning an associative array returns array as far as any type system is concerned, so nothing can check the keys. A docblock with a shape gives…

  • Choreography and orchestration are both fine and different

    Choreography has each service react to events and know nothing about the whole; orchestration has one component call the others in order. The first is presented as the…

  • The keyword type replaced not_analyzed

    Expressing “index this exactly, do not tokenise it” used to be “type”: “string”, “index”: “not_analyzed”. From 5.0 the string type is split in two and the intent is…

  • An entity has identity; a value object does not

    Two customers with the same name are different customers; two amounts of 49.00 TRY are the same amount. That distinction decides equality, mutability and whether the thing needs…

  • 4.7 added a settings API for the REST API

    Options registered with register_setting() can now appear on /wp/v2/settings, which turns a plugin’s configuration into something an admin interface elsewhere can read and write without a bespoke endpoint.…

  • Shard count is decided once and regretted later

    The number of primary shards is fixed when the index is created and cannot be changed. The default of five was chosen for a different era of cluster…