Logo
Logo
249 results for
  • When I first started writing Rust, I used match on every single Result and Option. My code looked like a staircase — match inside match inside match, indented halfway across the screen. Then a colleague showed me combinators, and suddenly the code read like prose instead of a tax form.

    Result: More Than Just Ok and Err

    You already know Result<T, E> has two variants. But Result comes with a huge set of methods that let you transform, combine, and short-circuit without writing explicit match blocks everywhere.

    Rust tutorial rust error-handling Created Sun, 07 Jul 2024 08:45:00 +0000
  • The concept of “customer” meant something different in every team I talked to at one company. To the billing team, a customer was a billing account. To the support team, a customer was a person who filed tickets. To the identity team, a customer was an authenticated principal. Every team had their own Customer struct, and syncing them was a full-time job. That’s the problem DDD’s bounded context concept solves — and it’s one of those ideas that sounds academic until you’ve suffered without it.

    fundamentals architecture Created Sun, 07 Jul 2024 00:00:00 +0000
  • The most expensive architectural mistake I’ve seen teams make with microservices is splitting by technical layer instead of by business capability. I’ve seen systems with a “UserDataService,” a “UserLogicService,” and a “UserNotificationService” — three services that all have to be deployed together for any user-related feature to work, that share a database, and that call each other synchronously for every request. They’re not microservices; they’re a distributed monolith with extra network latency.

    Go tutorial golang microservices Created Sat, 06 Jul 2024 00:00:00 +0000
  • I spent three years writing Java before I touched Rust. In Java, any function call might throw an exception — checked, unchecked, runtime, whatever. You never really know what’s going to blow up until it does. The first time I wrote Rust code that forced me to handle every possible failure at the call site, I thought it was annoying. Six months later, I realized it was the sanest approach to errors I’d ever used.

    Rust tutorial rust error-handling Created Fri, 05 Jul 2024 11:23:00 +0000
  • The first time I wrote authentication logic, I put it directly inside each handler. Copy-paste, then copy-paste again. By handler number five I had four slightly different versions of the same JWT check scattered across the codebase. When the security team asked me to add a new validation step, I had to find and update every single one. That was the day I understood middleware.

    The Problem

    Business logic in a handler should answer one question: “What does this endpoint do?” But handlers inevitably accumulate cross-cutting concerns — logging, authentication, rate limiting, request ID injection, panic recovery. When these live inside the handler body, every handler becomes a tangle of concerns that are hard to test, hard to change, and impossible to apply consistently.

    Go tutorial golang backend Created Fri, 05 Jul 2024 00:00:00 +0000
  • I was building a linear algebra library and got tired of writing vector_a.add(&vector_b) everywhere. It looked ugly. It read poorly. Math should look like math — a + b, not a.add(&b). In Rust, operator overloading isn’t some dark magic — it’s just trait implementation. Every operator maps to a trait in std::ops, and implementing that trait makes the operator work on your type.

    The Add Trait

    The + operator desugars to a call to Add::add:

    Rust tutorial rust traits generics Created Thu, 04 Jul 2024 20:15:00 +0000
  • Physics is the enemy of performance. Light travels through fiber optic cables at about 200,000 km/s — roughly two-thirds the speed of light in a vacuum. A round-trip from New York to London is about 11,000 km each way. That means the minimum possible latency for that trip is 55ms. You cannot engineer your way past it. What you can do is stop making the trip at all. Content Delivery Networks are the infrastructure that puts popular content at the edge — closer to users, so the bytes never have to travel far.

    fundamentals system design Created Thu, 04 Jul 2024 00:00:00 +0000
  • Graph traversal sounds abstract until you realize that most interesting data in production is a graph. Service dependencies are a graph. Database foreign key relationships form a graph. Build tool dependencies, org charts, permission hierarchies, network topologies — all graphs. BFS and DFS are the two fundamental ways to walk them, and they show up in real engineering work more than almost any other algorithm.

    I have used DFS to detect circular imports in a build system, BFS to find the shortest migration path between two schema versions, and both to debug why a dependency injection container was resolving services in the wrong order.

    fundamentals algorithms Created Wed, 03 Jul 2024 00:00:00 +0000
  • There’s a tier list of Rust traits. Some you’ll implement once in your career. Some you’ll implement weekly. And then there are the ones you’ll implement so often they become muscle memory — Display, From, Default, Iterator. These four (plus a few friends) are the backbone of idiomatic Rust. If you internalize them, your types will feel native. If you skip them, your types will feel like second-class citizens in the ecosystem.

    Rust tutorial rust traits generics Created Tue, 02 Jul 2024 08:30:00 +0000
  • Every Go web service I’ve reviewed starts with net/http. Most of them use it correctly for the obvious parts and incorrectly for the subtle ones. The package API is deceptively simple — http.HandleFunc, http.ListenAndServe, and you’re serving HTTP. But the design decisions underneath — how request routing works, what a Handler actually is, how the server manages connections, what the default timeouts are — contain enough traps to keep a senior engineer busy for a week.

    Go tutorial golang stdlib Created Tue, 02 Jul 2024 00:00:00 +0000