3 ms·
I really wish we would adopt the term CADRe intead of RAII: "Constructor Allocates, Destructor Releases" is much clearer a phrase than "Resource Acquisition
by einpoklum 2y ago
I really wish we would adopt the term CADRe intead of RAII:
"Constructor Allocates, Destructor Releases"
is much clearer a phrase than
"Resource Acquisition Is Initialization"
which, in English, can mean any number of things, particularly initialziation that's distinct from construction.
- tjoff 2y agoWhich is the point. RAII is very much not only used for memory nor construction. Not saying it is a good term, but we are stuck with it and trying to change it to a better one will only make it worse.
- joshuaissac 2y agoOr "constructor acquires, destructor releases". When I learned about RAII for the first time, its meaning was not clear at all from the phrase "resource acquisition is initialization".
- einpoklum 2y agoYes, perhaps that's even better.