Skip to content
HomeVideos
AllLongsCategoriesPlaylists
BooksBlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    Casey Muratori | Smart-Pointers, RAII, ZII? Becoming an N+2 programmer

    xDahl

    6 HN recommenders · recommended in 7 months, 2024–2026

    YouTube

    30:12 · 163K views · Jul 13, 2024

    Casey Muratori argues against smart pointers and RAII, advocating grouped-element thinking, zero-is-initialization and stubs as better ways to structure memory and handle errors.

    HN commenters in memory management and language design threads cite it as the best explanation of group lifetimes versus per-object ownership.

    Software Engineering & LanguagesC, C++, Rust, Go & systems languagesSoftware architecture & design
    1. 2:27:34
      Casey Muratori – The Big OOPs: Anatomy of a Thirty-five-year Mistake – BSC 2025Better Software Conference929K views • 1 year ago
    2. 46:40
      Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)ChimiChanga416K views • 2 years ago
    3. 18:41
      Refterm Lecture Part 1 - Philosophies of OptimizationMolly Rocket93K views • 5 years ago
    4. 1:39:25
      CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”CppCon149K views • 10 years ago
    5. 2:50:14
      Simple Code, High PerformanceMolly Rocket464K views • 5 years ago
    6. 1:54:00
      Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022CppCon277K views • 3 years ago
    7. 1:27:46
      CppCon 2014: Mike Acton "Data-Oriented Design and C++"CppCon863K views • 12 years ago
    8. 59:53
      CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”CppCon147K views • 7 years ago
    9. 48:30
      What's a Memory Allocator Anyway? - Benjamin FengZig SHOWTIME89K views • 6 years ago
    10. 1:48:55
      The Thirty Million Line ProblemMolly Rocket326K views • 8 years ago
    11. 34:55
      "Outperforming Imperative with Pure Functional Languages" by Richard FeldmanStrange Loop Conference98K views • 5 years ago
    12. 51:27
      Google I/O 2012 - Go Concurrency PatternsGoogle for Developers894K views • 14 years ago
    13. 1:13:41
      CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"CppCon235K views • 12 years ago
    14. 12:31
      OSCON 2010: Rob Pike, "Public Static Void"O'Reilly119K views • 16 years ago
    15. 23:12
      dotGo 2015 - Rob Pike - Simplicity is Complicateddotconferences172K views • 10 years ago
    16. 22:41
      "Clean" Code, Horrible PerformanceMolly Rocket1.2M views • 3 years ago
    17. 1:19:52
      CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”CppCon264K views • 10 years ago
    18. 1:19:57
      Simon Peyton Jones: Data Parallel HaskellnuACM28K views • 16 years ago
    19. 1:03:31
      Brian Goetz - Stewardship: the Sobering PartsClojureTV39K views • 11 years ago
    20. 7:44
      Handmade Hero | Getting rid of the OOP mindsetvexe167K views • 9 years ago

    9 comments from Hacker News

    1. @gingerBillJan 2026· in “Odin: Moving Towards a New "core:OS"”

      Unfortunately I don't think you've understand what I was I trying to say. Rust was designed from day-0 around explicit individual-value based initialization. Odin from day-0 was not designed around this (explicitly). This ever so minor choice might not seem like a big thing to you, as you have stated in your comment, but it leads to MASSIVE architectural decisions later on when the user programs. Odin could not "just add" non-nil pointers and it be "fine". It would actually not be Odin any more, and the entire language would not even be a C alternative any more, and feel much more like C++ or Rust. Rust and OCaml (which Rust is based off) are different kinds of languages to Odin and their approach does not translate well to what Odin (or C) is trying to do. Unfortunately I will not be able to explain this to you in a comment or article, and it is something that takes a while to understand since it is a subtle effect of locality affecting globality. The best video on this might be from Casey Muratori: this video > Yes, initialization can be less efficient in Rust but then most of the time spent is spend in algorithms when they run, not during initialization of the data structure. Sadly this isn't as true as you think it is. I've written a lot of C++ code before and doing its boilerplate for ctors/dtors actually leads to much slower code in general, and I'd argue this does apply to Rust too. Most of the time isn't necessarily spent in "algorithms", especially when "algorithms" als

      Strongly recommendsView on HN
    2. @bsderSep 2024· in “Committing to Rust in the Kernel”

      C and C++ are very different. I think Casey Muratori hits the nail on the head here: this video In short, RAII and smart pointers and borrow checker are all signs of "individual element thinking" and that way lies madness. You smear out lifetime and ownership so badly that it practically by definition becomes a problem. Your goal is to think about this stuff in groups to make thinking about allocation way, way easier. Programming is all about abstracting to the next layer. I'm not sure he has quite gotten to the heart of the issue, yet. However, a bunch of smart people (Casey Muratori, Jonathan Blow, Andrew Kelley, etc.) are all dancing around something that Rust and C++ don't seem to fit the bill on. Hopefully they can crystallize it out so that everybody can see it.

      Strongly recommendsView on HN
    3. @jackclaytonJul 2026· in “Claude Code uses Bun written in Rust now”

      Above poster is talking about thinking in terms of grouped lifetimes and bulk allocations/deallocations, which is better for performance, and makes Rust borrow checking and other RAII style features completely pointless as they don't add any safety benefits. I used to think like you until I watched this video: this video I can confirm after exploring programming like the above video explains, that everything he says is completely true.

      Strongly recommendsView on HN
    4. @ChrisTrenkampMay 2026· in “Bun ported to Rust in 6 days”

      This is a hot take, but programming languages haven't progressed since the 90's. We've been conditioned to believe that if you want to be a serious programmer, you have to either use C++-style RAII (which includes Rust), or garbage collection, and there's no in-between, and C programmers are dinosaurs who can be ignored. Arena allocators are a great way to automatically manage memory allocations. You malloc a whole bunch of memory and release it all with a single free, which makes it much easier to reason about your program's memory safety. Casey Muratori has a good video talking about this. this video And about Zig, you have an Arena Allocator out of the box: [LINK] . And it's not just limited to that, you have debug allocators that detects memory leaks and gives you stack traces where they occurred. This isn't to say that Zig is great at everything. I think Rust is great for things like kernels, high-frequency trading systems, and authentication servers where memory safety and performance is paramount. But for things like video games, memory leaks and buffer overflows aren't that big of a deal, and Zig's "Good Enough" approach is great for those types of applications.

      RecommendsView on HN
    5. @gingerBillMay 2025· in “Odin: A programming language made for me”

      > It seems to me... that initialization time is unlikely to be significant The thing is, initialization cost is a lot more than you think it is, especially when it's done on a per-object level rather than a "group" level. This is kind of the point of trying to make the zero value useful, it's trivially initialized. And in languages that are much more strict in their approach, it is done at that per-object level which means instead of the cost of initialization being anywhere from free (VirtualAlloc/mmap has to produce zeroed memory) to trivially-linear (e.g. memset), to being a lot more nested hierarchies of initialization (e.g. for-loop with constructor for each value). It's non-obvious why the "strict approach" would be worse, but it's more about how people actually program rather than a hypothetical approach to things. So of course each style is about trade-offs. There are no solutions, only trade-offs. And different styles will have different trade-offs, even if they are not immediately obvious and require a bit of experience. A good little video on this is from Casey Muratori, "Smart-Pointers, RAII, ZII? Becoming an N+2 programmer": this video

      RecommendsView on HN