digitalmars.D - RAII -- a misnomer?
- Georg Wrede (41/41) Jan 25 2006 IMHO, RAII (Resource Acquisition Is Initialization) is
- kris (4/58) Jan 25 2006 Well said, Georg.
- Sean Kelly (5/28) Jan 25 2006 Or perhaps Value-Based Resource Management, Scoped Resource Management,
- Hasan Aljudy (2/56) Jan 25 2006
- Don Clugston (6/14) Jan 25 2006 I agree. I could never understand why the term "destructor" was
- Sean Kelly (5/9) Jan 26 2006 Maybe if the name were changed it would encourage the programmers at
- Bruno Medeiros (16/20) Jan 29 2006 I do agree it's a misnomer, however, it may have it's reasons to be so.
- Mike Capp (15/21) Jan 29 2006 Auto variables (in the C/C++ sense) are only half the story. The other h...
- Hasan Aljudy (10/29) Jan 30 2006 Isn't that what a minsomore is?
- James Dunne (10/42) Jan 31 2006 I've also come to find the word 'professional' a huge misnomer.
IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!! The name seems to refer to the beginning of resource usage _only_. At the same time it seems that RAII is _exclusively_ about resource release. Grrrrrrrrrrrrr. Somebody please shoot the name inventor!! --- My opinion: Since resources are acquired anyhow (with or without RAII) when they are needed, the A-word should not even exist in the name. The term is misleading (pompous and bureaucratic) to such an extent that when a programmer hears it for the first time, he thinks "arrghh, another sick acronym: probably it's something conceptually trivial, but it sounds too hard to check out today". Well, time passes and he stays confused. (Happened to me the year I saw it in this newsgroup. Took me at least a couple of months before I got fed up and dug to the bottom of it. Geez!) Suppose it was called RR (for Resource Release)? ================================================ I bet most anybody would grok it at first sight. Half the guys wouldn't even need an explanation! ((I sure hope Herb Sutter wasn't the one who invented the term. For if it was, then I'd accuse him of being an old man who wants to make his writing seem more important than it is. (Not that he'd have to, but old people in this proffession do end up doing that, sooner or later.))) --- "Does your language support RR?" "What's that?" "Resource Release." "Huh?" "That resources, like files and stuff, get released when they go out of scope." "Ah, sure! I use D!" *versus* "Does your language support RAII?" "What's that?" "Resource Acquisition Is Initialization." "What the f**k???" "Not sure, but you have to have it to be cool. Wikipedia explains it as 'a technique that combines acquisition and release of resources with initialization and uninitialization of variables'". to name his own language, in case it doesn't support this buzzword.)
Jan 25 2006
Well said, Georg. Given that D is a grass-roots effort, you'd think it would avoid such elitisms :) Georg Wrede wrote:IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!! The name seems to refer to the beginning of resource usage _only_. At the same time it seems that RAII is _exclusively_ about resource release. Grrrrrrrrrrrrr. Somebody please shoot the name inventor!! --- My opinion: Since resources are acquired anyhow (with or without RAII) when they are needed, the A-word should not even exist in the name. The term is misleading (pompous and bureaucratic) to such an extent that when a programmer hears it for the first time, he thinks "arrghh, another sick acronym: probably it's something conceptually trivial, but it sounds too hard to check out today". Well, time passes and he stays confused. (Happened to me the year I saw it in this newsgroup. Took me at least a couple of months before I got fed up and dug to the bottom of it. Geez!) Suppose it was called RR (for Resource Release)? ================================================ I bet most anybody would grok it at first sight. Half the guys wouldn't even need an explanation! ((I sure hope Herb Sutter wasn't the one who invented the term. For if it was, then I'd accuse him of being an old man who wants to make his writing seem more important than it is. (Not that he'd have to, but old people in this proffession do end up doing that, sooner or later.))) --- "Does your language support RR?" "What's that?" "Resource Release." "Huh?" "That resources, like files and stuff, get released when they go out of scope." "Ah, sure! I use D!" *versus* "Does your language support RAII?" "What's that?" "Resource Acquisition Is Initialization." "What the f**k???" "Not sure, but you have to have it to be cool. Wikipedia explains it as 'a technique that combines acquisition and release of resources with initialization and uninitialization of variables'". to name his own language, in case it doesn't support this buzzword.)
Jan 25 2006
Georg Wrede wrote:IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!! The name seems to refer to the beginning of resource usage _only_. At the same time it seems that RAII is _exclusively_ about resource release. Grrrrrrrrrrrrr. Somebody please shoot the name inventor!! --- My opinion: Since resources are acquired anyhow (with or without RAII) when they are needed, the A-word should not even exist in the name. The term is misleading (pompous and bureaucratic) to such an extent that when a programmer hears it for the first time, he thinks "arrghh, another sick acronym: probably it's something conceptually trivial, but it sounds too hard to check out today". Well, time passes and he stays confused. (Happened to me the year I saw it in this newsgroup. Took me at least a couple of months before I got fed up and dug to the bottom of it. Geez!) Suppose it was called RR (for Resource Release)?Or perhaps Value-Based Resource Management, Scoped Resource Management, etc. RAII is only a useful term because people know what it refers to, not because it is in itself particularly meaningful. Sean
Jan 25 2006
Totally agree, man!! Georg Wrede wrote:IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!! The name seems to refer to the beginning of resource usage _only_. At the same time it seems that RAII is _exclusively_ about resource release. Grrrrrrrrrrrrr. Somebody please shoot the name inventor!! --- My opinion: Since resources are acquired anyhow (with or without RAII) when they are needed, the A-word should not even exist in the name. The term is misleading (pompous and bureaucratic) to such an extent that when a programmer hears it for the first time, he thinks "arrghh, another sick acronym: probably it's something conceptually trivial, but it sounds too hard to check out today". Well, time passes and he stays confused. (Happened to me the year I saw it in this newsgroup. Took me at least a couple of months before I got fed up and dug to the bottom of it. Geez!) Suppose it was called RR (for Resource Release)? ================================================ I bet most anybody would grok it at first sight. Half the guys wouldn't even need an explanation! ((I sure hope Herb Sutter wasn't the one who invented the term. For if it was, then I'd accuse him of being an old man who wants to make his writing seem more important than it is. (Not that he'd have to, but old people in this proffession do end up doing that, sooner or later.))) --- "Does your language support RR?" "What's that?" "Resource Release." "Huh?" "That resources, like files and stuff, get released when they go out of scope." "Ah, sure! I use D!" *versus* "Does your language support RAII?" "What's that?" "Resource Acquisition Is Initialization." "What the f**k???" "Not sure, but you have to have it to be cool. Wikipedia explains it as 'a technique that combines acquisition and release of resources with initialization and uninitialization of variables'". to name his own language, in case it doesn't support this buzzword.)
Jan 25 2006
Georg Wrede wrote:IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!! The name seems to refer to the beginning of resource usage _only_. At the same time it seems that RAII is _exclusively_ about resource release. Grrrrrrrrrrrrr. Somebody please shoot the name inventor!!I agree. I could never understand why the term "destructor" was inadequate to describe it. Especially since "put it back when you've finished with it" is a concept which is hundreds of years old, Mind you, there have been some other dreadful misnomers in computer language history.
Jan 25 2006
Don Clugston wrote:I agree. I could never understand why the term "destructor" was inadequate to describe it. Especially since "put it back when you've finished with it" is a concept which is hundreds of years old,Maybe if the name were changed it would encourage the programmers at work to put milk back in the refrigerator when they're finished with it. That's a cause I could stand behind! ;-) Sean
Jan 26 2006
Georg Wrede wrote:IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!!I do agree it's a misnomer, however, it may have it's reasons to be so. I did a quick look at it's wikipedia entry, and I suspect it's called that because RAII actually means: "The acquisition is bound to the construction (initialization) whereas the release is bound to the destruction (uninitialization) of the variable", which is not the same as automatic variables, altough it has everything to do with that. In fact, under that definition RAII is a programming idiom/pattern, not a language feature (like auto variables). RAII seems useless without auto variables, though, so people blend the two concepts together. Perhaps a more experienced developer can confirm this. -- Bruno Medeiros - CS/E student "Certain aspects of D are a pathway to many abilities some consider to be... unnatural."
Jan 29 2006
In article <drigjt$2b80$1 digitaldaemon.com>, Bruno Medeiros says...[RAII] is not the same as automatic variables, altough it has everything to do with that. In fact, under that definition RAII is a programming idiom/pattern, not a language feature (like auto variables). RAII seems useless without auto variables, though, so people blend the two concepts together. Perhaps a more experienced developer can confirm this.Auto variables (in the C/C++ sense) are only half the story. The other half is the problem of composition - if your A contains a B which owns an array of polymorphic pointers to C-derived classes which could contain nasal demons for all you know, then being able to call A's destructor when it goes out of scope doesn't really cut it. You also need to know that any important resources managed by the B or C-derived objects get released. It's really not something you want to have to do (or maintain) manually. Aside from awkward hybrids like C++/CLI, I've yet to see a garbage-collected language that can tell a good story here. Which isn't to say that it's impossible, ("We'll never survive!" "Nonsense; you're only saying that because no-one ever has.") but it does support my prejudice that GC languages aren't a good fit for domains/apps where resource management is a big deal. cheers Mike
Jan 29 2006
Bruno Medeiros wrote:Georg Wrede wrote:Isn't that what a minsomore is? instead of statically allocated arrays, we could say - Hey, my language supports CTMSA!! -- what the **** is that? - compile time memory space allocation!! -- gimme a break! Plus, RAII is still meaningless, just because the initialization is the acquisition, it doesn't mean that the destruction of the objects will release any resources!! Total nonsense, man .. total nonsense ..IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!!I do agree it's a misnomer, however, it may have it's reasons to be so. I did a quick look at it's wikipedia entry, and I suspect it's called that because RAII actually means: "The acquisition is bound to the construction (initialization) whereas the release is bound to the destruction (uninitialization) of the variable", which is not the same as automatic variables, altough it has everything to do with that. In fact, under that definition RAII is a programming idiom/pattern, not a language feature (like auto variables). RAII seems useless without auto variables, though, so people blend the two concepts together. Perhaps a more experienced developer can confirm this.
Jan 30 2006
Hasan Aljudy wrote:Bruno Medeiros wrote:I've also come to find the word 'professional' a huge misnomer. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/MU/S d-pu s:+ a-->? C++++$ UL+++ P--- L+++ !E W-- N++ o? K? w--- O M-- V? PS PE Y+ PGP- t+ 5 X+ !R tv-->!tv b- DI++(+) D++ G e++>e h>--->++ r+++ y+++ ------END GEEK CODE BLOCK------ James DunneGeorg Wrede wrote:Isn't that what a minsomore is? instead of statically allocated arrays, we could say - Hey, my language supports CTMSA!! -- what the **** is that? - compile time memory space allocation!! -- gimme a break! Plus, RAII is still meaningless, just because the initialization is the acquisition, it doesn't mean that the destruction of the objects will release any resources!! Total nonsense, man .. total nonsense ..IMHO, RAII (Resource Acquisition Is Initialization) is THE WORST MISNOMER IN COMPUTER LANGUAGE HISTORY !!!I do agree it's a misnomer, however, it may have it's reasons to be so. I did a quick look at it's wikipedia entry, and I suspect it's called that because RAII actually means: "The acquisition is bound to the construction (initialization) whereas the release is bound to the destruction (uninitialization) of the variable", which is not the same as automatic variables, altough it has everything to do with that. In fact, under that definition RAII is a programming idiom/pattern, not a language feature (like auto variables). RAII seems useless without auto variables, though, so people blend the two concepts together. Perhaps a more experienced developer can confirm this.
Jan 31 2006