Casey Muratori | Smart-Pointers, RAII, ZII? Becoming an N+2 programmer
6 人推荐 · 跨 6 个月 · 2024–2026

中文导读
知名游戏程序员 Casey Muratori 旗帜鲜明地反思现代 C++ 中的 smart pointers 与 RAII 模式。他主张回归“按组管理生命周期”(grouped-element thinking)、利用 zero-is-initialization 与打桩方案,从架构层面实现更简洁高效的内存布局与错误处理。
为什么 HN 推它
在内存管理和编程语言设计的讨论中被高频引用的硬核视频,把“按批次管理对象生命周期”与“单对象所有权追踪”的本质优劣讲得淋漓尽致。
「聊到这个技术方向,讲得最透彻的可能非 Casey Muratori 这个视频莫属。」HN 网友原话:The best video on this might be from Casey Muratori
英文原摘要(HackerTube / Claude 整理)
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.
HN 上的提及
I think Casey Muratori hits the nail on the head here
Describes grouped element thinking.
Much better outcomes and failure modes than RAII.
A good little video on this is from Casey Muratori
extremely informative, but also stupidly gatekeepy