Logo
Logo
10 results for
  • I came to WebAssembly skeptically. The pitch — “run code anywhere, at near-native speed, in a sandboxed environment” — sounded like the kind of claim that looks great in a conference talk and falls apart in production. It took a specific use case to make me take it seriously: I needed to run the same validation logic in three environments — a Go backend, a JavaScript frontend, and a CLI tool — without maintaining three separate implementations of the same business rules.

    fundamentals WebAssembly WASM Created Fri, 12 Jul 2024 00:00:00 +0000
  • The Go compiler refuses to build a program with a cyclic import. It is not a warning. It is not a lint violation. It is a hard failure. I used to find this annoying when I was newer to the language. Now I consider it one of Go’s greatest gifts. The compiler is telling you something important: if package A needs package B and package B needs package A, you have not yet understood what the relationship between these two concepts really is.

    Go tutorial golang architecture Created Fri, 12 Jul 2024 00:00:00 +0000
  • I once worked on a project where every error was Box<dyn std::error::Error>. Debugging was miserable. When something failed in production, the logs said things like “invalid input” with zero context about which input, where in the pipeline, or why it was invalid. That’s when I learned that good error types aren’t an afterthought — they’re part of your domain model.

    Why Custom Error Types Matter

    Standard library errors like io::Error and ParseIntError are fine for what they describe. But your application has its own failure modes. A payment processor doesn’t just fail with “IO error” — it fails with “card declined,” “insufficient funds,” “gateway timeout,” “idempotency key conflict.” These are domain-specific failures that deserve domain-specific types.

    Rust tutorial rust error-handling Created Thu, 11 Jul 2024 19:15:00 +0000
  • The first time I ran EXPLAIN ANALYZE on a slow query, I stared at the output for five minutes and understood none of it. It looked like a compiler error message crossed with a financial report. Then a senior engineer walked me through it, and what had looked like noise resolved into a clear picture: this node was doing more work than the planner expected, this join strategy was wrong, this sort was spilling to disk. EXPLAIN ANALYZE is the most powerful tool in database performance work, and it takes an hour to learn but pays back every week for the rest of your career.

    fundamentals databases Created Thu, 11 Jul 2024 00:00:00 +0000
  • Before const generics landed (Rust 1.51), working with arrays was painful. You couldn’t write a function that accepted [T; N] for any N. The standard library had trait implementations for arrays up to size 32 — manually written, one per size. Need [u8; 33] to implement Debug? Too bad. That era is over, and honestly, const generics are one of the most underappreciated features in modern Rust.

    Instead of parameterizing types by other types, you parameterize them by values. An array’s size, a buffer’s capacity, a matrix’s dimensions — baked into the type system at compile time.

    Rust tutorial rust traits generics Created Wed, 10 Jul 2024 15:30:00 +0000
  • There’s a class of bugs that you will never find by thinking about edge cases. You’ll think about empty strings, about zero values, about negative numbers. But will you think about the string that’s exactly 65,536 bytes? Or the UTF-8 sequence that’s technically valid but trips up a specific parser codepath? Or the floating point value that serializes and then fails to deserialize because of a precision edge in your JSON handling? You won’t. But a fuzzer will find it in under a minute.

    Go tutorial golang testing Created Wed, 10 Jul 2024 00:00:00 +0000
  • Before the ? operator existed, Rust had try!() — a macro that did the same thing but looked ugly and nested poorly. When ? landed in Rust 1.13, it was one of those rare language changes where everyone immediately agreed it was better. I remember refactoring an entire crate the same week, deleting dozens of match blocks and try!() calls, and the code just… breathed.

    What ? Actually Does

    The ? operator is syntactic sugar for early return on error. When you write this:

    Rust tutorial rust error-handling Created Tue, 09 Jul 2024 14:30:00 +0000
  • Every time your operating system picks the next process to run, it’s using a heap. Every time Kubernetes re-schedules a pod, it’s using a priority queue. Every time you’ve written a “get top 10 most frequent items from a billion-row stream,” the efficient solution involves a heap. These are workhorses of systems programming that look simple on paper and have genuinely tricky implementation details.

    The heap is also one of my favorite data structures to explain because it demonstrates a beautiful property: you can implement a tree efficiently inside an array, using only arithmetic to find parent and child nodes.

    fundamentals data structures Created Tue, 09 Jul 2024 00:00:00 +0000
  • I once found database credentials committed directly in a Go source file — not in a toy project, in a staging environment of a real product. The developer who wrote it knew it was wrong, but they were “just testing” and forgot to revert it. That file lived in the repository for eight months before anyone noticed. By then, the credentials had been rotated, but the history was permanent.

    Secret handling in Go is not primarily a coding problem. It is a discipline problem. The code patterns are simple. The failures happen when you treat secrets as a detail to clean up later, or when you assume that environment variables are inherently safe because they are not in source code.

    Go tutorial golang security Created Mon, 08 Jul 2024 00:00:00 +0000
  • “Zero-cost abstractions” is Rust’s battle cry. But what does that actually mean for generics? How does Vec<i32> and Vec<String> both exist without runtime overhead? The answer is monomorphization — the compiler generates a separate, specialized copy of your generic code for each concrete type used. You write it once, the compiler duplicates it for each type, and the result runs as fast as hand-written specialized code.

    This is brilliant. It’s also a double-edged sword. And understanding the mechanism changes how you design generic APIs.

    Rust tutorial rust traits generics Created Sun, 07 Jul 2024 11:45:00 +0000