RAII Resource Management
The cluster focuses on discussions of RAII (Resource Acquisition Is Initialization), its role in C++ for automatic resource cleanup via destructors, comparisons to alternatives like try-finally, defer, or finally clauses in other languages such as Rust, Go, Java, and debates on its effectiveness and implementations.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Because RAII isn't amazing?
but.. with RAII you don't either, that's the whole point
Perhaps you meant RAII [1] ?[1] http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initial...
Is RAII in C a serious suggestion being made anywhere?
How does this compare to using RAII in C++ in terms of generated code?
You can do RAII without constructors (e.g. Rust)
In what possible way can RAII be said to do those things?
I would strongly disagree on RAII being a kludge in C++. The language feature that enables it is deterministic destructors, whose primary purpose is to ensure that allocated resources are deallocated. RAII is one particular use of destructors. The primary goal is to have the object be the thing that owns a resource, not the calling scope.In terms of usability, destructors allow for resource management that is far easier at the call site than any other language. "with" blocks suc
sure, it's just a small, but non-negligeable, part of RAII that you can do in C
It sounds like you simply don't know RAII.