Live data from Hacker News

Ask HN: What should have been the term for RAII?

news.ycombinator.com

1–10 of 62 posts

Ask HN: What should have been the term for RAII?

#1
Bjarne Stroustrup himself said he was very busy when he came up with the name for this concept, that it’s not a very good name, and joked he’s not good at “marketing“.

What would be a better terminology?

As I’ve been learning modern C++, I admit that I’ve struggled to understand why these terms make sense. To me, I think of it like “Resource Acquisition Promising Release”. Does this betray that I am not truly understanding Strourstrup’s principle?

Re: Ask HN: What should have been the term for RAII?

#5
post #4

I’m a Rust programmer but I would call it scope-based or scope-bound resource management, a popular alternative term in the C++ community.

RAII isn't just about automatic ("scope-based") variables. RAII refers to the way the language ties together the construction and allocation of the object.

Re: Ask HN: What should have been the term for RAII?

#6
post #5
post #4

I’m a Rust programmer but I would call it scope-based or scope-bound resource management, a popular alternative term in the C++ community.

RAII isn't just about automatic ("scope-based") variables. RAII refers to the way the language ties together the construction and allocation of the object.

Are there languages that do SBRM but not RAII?

Re: Ask HN: What should have been the term for RAII?

#7
post #6
post #5

Earlier quoted context omitted.

RAII isn't just about automatic ("scope-based") variables. RAII refers to the way the language ties together the construction and allocation of the object.

Are there languages that do SBRM but not RAII?

Rust doesn’t have initializers in the C++ sense. And I mean, even in C++ many classes like shared_ptr or even lock_guard have constructors that don’t acquire the resources yet. When the resource is acquired is an API design concern; the important part is where it’s released.
Post reply on HN