Logo
Logo
10 results for
  • I’ve read the Clean Architecture book. I’ve also seen teams implement it so literally that they had six layers of indirection for a CRUD endpoint: a controller called a use case, which called a domain service, which called a port, which went through an adapter, which called a repository, which hit the database. Each hop had its own error mapping. Changing a database column required touching eight files. That’s not clean. That’s engineering theater.

    fundamentals architecture Created Sun, 19 May 2024 00:00:00 +0000
  • I’ll say something controversial: Clippy taught me more about idiomatic Rust than any book. Not because it explains concepts — it doesn’t. But because it catches you every time you write non-idiomatic code and shows you the better way. It’s like having a senior Rust developer looking over your shoulder, constantly saying “there’s a cleaner way to do that.”

    Run cargo clippy on every project. Every commit. No exceptions.


    What Clippy Is

    Clippy is Rust’s official linter — over 700 lint rules that catch everything from style issues to actual bugs. It ships with rustup, so you already have it.

    Rust tutorial rust idiomatic-rust Created Sat, 18 May 2024 10:55:00 +0000
  • Binary search has a reputation as a simple algorithm — and it is, conceptually. Divide the search space in half, check the middle, repeat. Every programmer knows this. Yet I have seen engineers reach for a linear scan when binary search would have solved the problem in a fraction of the time, and I have also seen subtly buggy binary search implementations that work 99.9% of the time and silently fail on edge cases.

    fundamentals algorithms Created Sat, 18 May 2024 00:00:00 +0000
  • The first time Rust told me I couldn’t use a variable after assigning it to another one, I stared at my screen for a solid minute. In what universe does let b = a make a invalid?

    This universe. Rust’s universe. And honestly — it’s the only sane default.

    What a Move Actually Is

    In most languages, let b = a copies the data or copies a reference. In Rust, for heap-allocated types, it moves the ownership. The bits get copied (the stack portion — pointer, length, capacity), but the old variable is invalidated.

    Rust tutorial rust ownership lifetimes Created Fri, 17 May 2024 14:45:00 +0000
  • I once worked on a crate that pulled in 200+ transitive dependencies because it unconditionally depended on tokio, serde, reqwest, and tracing. Most users only needed one of those. The compile time was brutal, and the binary was enormous.

    Feature flags solve this. They let users opt into functionality they need and skip everything else. It’s the “pay for what you use” principle applied to compilation.


    cfg — Conditional Compilation

    The #[cfg(...)] attribute conditionally includes code based on compile-time configuration:

    Rust tutorial rust idiomatic-rust Created Thu, 16 May 2024 12:45:00 +0000
  • I spent three days debugging a production incident where two nodes in our cluster both believed they were the primary. Each was accepting writes. Each was replicating to followers. Each was convinced the other was dead. By the time we noticed, we had diverged state that took two more days to reconcile. That incident made me obsessive about leader election — not as an academic concept, but as a concrete engineering problem with real failure modes.

    fundamentals distributed systems Created Thu, 16 May 2024 00:00:00 +0000
  • I spent my first three months in Rust confused about ownership. Not because the concept is hard — it’s genuinely simple — but because every tutorial I read explained it through the lens of “rules to memorize.” Three rules. Memorize them. Move on.

    That’s backwards. You don’t learn ownership by memorizing rules. You learn it by understanding where your data actually lives.

    Where Data Lives Changes Everything

    Every value in your program sits in one of two places: the stack or the heap. If you’ve done any C or C++, this is familiar territory. If you haven’t — don’t worry, this isn’t as scary as systems programmers make it sound.

    Rust tutorial rust ownership lifetimes Created Wed, 15 May 2024 09:22:00 +0000
  • Hash maps are the workhorse of production software. Nearly every caching layer, session store, deduplication system, and configuration lookup you’ve ever written relies on one. They’re fast, they’re flexible, and they’re genuinely O(1) — with some asterisks that matter enormously in production.

    I want to walk through how they actually work, because the “O(1) lookup” claim hides a lot of complexity that shows up in the worst possible moments: under load, with adversarial input, or when your hash function is subtly wrong.

    fundamentals data structures Created Wed, 15 May 2024 00:00:00 +0000
  • The first time I saw ::<> in Rust code, I thought someone was having a stroke at the keyboard. collect::<Vec<_>>()? What is that colon-colon-angle-bracket monstrosity?

    It’s called the turbofish. Named by the community because ::<> looks like a fish (::<> — see the eyes and the mouth?). It’s goofy. It’s lovable. And once you understand it, you’ll use it constantly.


    What the Turbofish Does

    The turbofish provides explicit type parameters to generic functions or methods when the compiler can’t infer them.

    Rust tutorial rust idiomatic-rust Created Tue, 14 May 2024 08:22:00 +0000
  • The first time I looked at a waterfall chart in Chrome DevTools and saw a hundred requests stacking up like rush-hour traffic, I knew HTTP/1.1 was the problem. We had a dashboard loading twelve API calls and a handful of assets, and they were all waiting in line. Not because the server was slow — it was idle — but because the browser had a six-connection-per-host limit and every request had to wait its turn. That was my introduction to why HTTP/2 exists, and it changed how I think about protocol design.

    fundamentals networking Created Tue, 14 May 2024 00:00:00 +0000