Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Fri, 13 Apr 2012 00:59:07 -0500 From: Gareth Owen Newsgroups: comp.lang.c++ Subject: Re: Terminology - RAII vs. Scope Guard vs...? References: <2b96be9d-1925-4455-b6f9-12b2b15ebfad@x17g2000yqj.googlegroups.com> <2afef88f-f05f-4eb7-929b-fb587f674c68@er9g2000vbb.googlegroups.com> <9164b5b9-0424-4acf-9d2f-1344db90b3a7@w5g2000vbv.googlegroups.com> <4f8671dd$0$3116$7b1e8fa0@news.nbl.fi> <87ehrszx64.fsf@gmail.com> <4f87b11d$0$3081$7b1e8fa0@news.nbl.fi> Date: Fri, 13 Apr 2012 06:59:12 +0100 Message-ID: <871unsb2a7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:81+xCcE77Od3L+DN3aueqyWfthY= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 29 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-LgV/0UoZrJIyrlr9evmsS2DIM6R0OpSuripbg1IMp6XX5TUfAVuy/sAue6tRZYbWC1uyIIaM/1fX6W2!19Pvid984ft2VoRhi8hSd3qw5I1QblF2Wxl8OZ/DTjh2TKhNyP1dgkbFUPy+WNsyfsQ= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2618 Xref: csiph.com comp.lang.c++:15342 Juha Nieminen writes: > Gareth Owen wrote: >> You could define >> >> * a language that forces copyable object to have a java-like >> user-provided clone() for all objects, and no implicit copying or >> assignment for user defined types (just as many C++ polymorphic >> classes do) >> * or a language where every object acted like std::shared_ptr >> * or even (god forbid) a language where every object acted like >> std::auto_ptr >> >> and still have RAII, just as long as you had destruction when the last >> reference vanished. > > I suppose you could, but then you would be seriously hindering the > flexibility and efficiency of the language. Oh, undeniably. It would be a pretty terrible general purpose language - although the first one isn't massively removed from Java (which is why Java containers sucked for so long). But it might be a useful tool in certain domains, and you could still use exceptions to provide error handling, coupled with RAII to provided deterministic resource management. RAII is a necessary condition for a language not to suck, but its not sufficient. :)