Hello, World
This is the first post on my new site. I've been meaning to start writing for a while — not because I think the world needs another tech blog, but because writing forces me to think clearly about what I'm building and why.
Why write?
There's a quote I keep coming back to:
"Writing is thinking. To write well is to think clearly. That's why it's so hard."
Most of what I know about software, I learned by doing it wrong first. Writing about those mistakes — and occasionally the things that went right — helps me understand them better.
What to expect
I'll write about:
- Systems and infrastructure — the messy, unglamorous work that makes everything else possible
- Tools I build — CLI utilities, automation, the small programs that make daily work better
- Things I'm learning — distributed systems, performance, whatever rabbit hole I've fallen into
A code sample
Here's a function I wrote recently that made me unreasonably happy:
async function retry<T>(
fn: () => Promise<T>,
attempts: number = 3,
delay: number = 1000
): Promise<T> {
for (let i = 0; i < attempts; i++) {
try {
return await fn();
} catch (err) {
if (i === attempts - 1) throw err;
await new Promise((r) => setTimeout(r, delay * (i + 1)));
}
}
throw new Error("unreachable");
}Simple, but it replaced a dozen ad-hoc retry implementations across a codebase. Sometimes the best code is the code that deletes other code.
More soon. Thanks for reading.