Pleasant surprise this morning (had no idea this change was coming): in Ruby 4.0, logical operators for chained conditions can appear on the next line. FINALLY. nithinbekal.com/posts/ruby-4...
Brandur
Brandur
@brandur.org
Engineering @ Stainless. Ex-Heroku, Stripe, and Snowflake. Go, APIs, Ruby, and databases.
1.6K followers21 following79 posts
Everyone knows about async I/O and UUIDv7 in Postgres 18 by now, but I was surprised to find out that `RETURNING` is getting `OLD.*` + `NEW.*`! Great new feature. Lets me unwind some old hacks involving `xmax` to check if an upserted row is new or not. www.crunchydata.com/blog/postgre...
Getting back into Kubernetes for work after years away, my main takeaway is that although Kubernetes is still kind of a meh complexity/value proposition, Argo CD is absolutely incredible. Glad there's a Kubes CLI, but having a great UI to backstop you changes the game. cd.apps.argoproj.io
Today, came across a Go package literally named "event". Such bland naming doesn't just hurt users, it hurts the package because being hard to google makes it less likely to be adopted. Ultra-generic naming isn't cool. It's just bad. For the love of god: brandur.org/fragments/go...
Got a question the other day as to whether our API stack handles cancelled requests (disconnect in HTTP/1 or true cancellation in HTTP/2) by abandoning work midway through. Dug in. It does, but I'd bet money that most services don't handle this cleanly. brandur.org/fragments/te...
Podcast interview with Matz where Matz's sections in Japanese have been swapped out with AI to give him the voice of a distinguished English gentleman. en.kaigaiiju.ch
Ref. Excellent thread: x.com/XorDev/statu... Excellent joke: x.com/dshukertjr/s...
Some thoughts on the archival of Go's popular gopkg.in/yaml.v3 package. It's a 3-way race: • A vulnerability is discovered in gopkg.in/yaml.v3, becoming a widespread liability. • Testify drops gopkg.in/yaml.v3. • A new de facto assertion package is found.
Periodic callout to Jackc's Pgx, which is just *absurdly* solid software. Every time I think I've found a bug in it, it turns out to actually be my fault. It just happened again for like the 50th time. github.com/jackc/pgx
Upgraded projects to golangci-lint v2 yesterday. The change in conf format was a bit irking, but the built-in migration tool worked reasonably well. V2's error output is better in that it summarizes failing lints, and so far fewer obscure caching bugs compared to v1. ldez.github.io/blog/2025/03...
IMO, the right way to to do data fixtures in Go: * No framework needed, but use sqlc + validator. • Real DB records. • No error return to making calling succinct. • Pointer helpers to get 4 LOCs down to 1 LOC. • Defaults for everything possible. brandur.org/fragments/go...
We started measuring memory allocs over API requests in production to track down some sudden memory overruns. `runtime.MemStats` in Go needs to stop the world to get a stable reading, but we found its overhead for 2x calls an acceptable ~100µs. brandur.org/fragments/pr...
Ran into a nice surprise while looking at Postgres' UUIDv7 patch, which is that it guarantees monotonic incrementation on a per-backend basis. Last writing of 2024: UUIDv7 monotonicity, how it works, and why it's great for writing tests. Happy NY! brandur.org/fragments/uu...
Not going to lie, doesn't bode well for my equity position that after 15 years Stripe cut a /v2 API ... and nobody noticed and cared. 3 points on HN. Mini review: JSON requests, finally. More useful idempotency. But, no PATCH, still only pseudo-RESTful. docs.stripe.com/api-v2-overv...