Posts
Memory and Sync Primitives
Go zero-allocation needs escape analysis, sync.Pool reuse and the right primitive: atomic for one value, Mutex for a block of state, RWMutex if reads dominate.
HTML-first or SPA: Reset the Default, Skip the Holy War
The test is where state lives and whether interaction swaps content or drives local state; default to HTML-first and upgrade to the client only when you must.
A Thin BFF with Fastify
A BFF is a thin translation layer. Fastify v5's schema-driven validation and serialisation hold the boundary, with HMAC signing on downstream calls.
Why BFF Still Earns Its Keep in 2025
A BFF is not a fashionable layer. It is where you make plain who faces the browser, who faces the backend, and who carries the risk.
Interactions as HTTP: What htmx Gets Right
htmx reduces interactivity to request/response, keeps state on the server, and asks whether you actually needed a SPA in the first place.
Markup First: Describe the Structure, Then the Behaviour
Rather than starting from framework components, describe the structure in HTML first and let behaviour be a thin layer on top.
Goroutines and Channels
Goroutines are cheap but leak without an exit, channels synchronise, and one goroutine owning state needs no lock. Plain counters want a mutex or atomic.