From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 17 May 2008 09:26:48 -0500 From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: memory management in Ada: tedious without GC? Date: Sat, 17 May 2008 15:30:17 +0100 Reply-To: brian@shapes.demon.co.uk Message-ID: References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-900nNThc4Nw566FL10FAcZqa/o+mMaArWQAH8JFmNrNt+TfQwl04rn/at191NAsMtrwv2hy7cFpTjTy!lnONa73ZgdFc43/ep9kcxLU8fXD+c2J31Voem7ZrwbtO/0aBK9maKbuhtal/XDPKRBmZvJcuTSNz!IVto X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com 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.38 Xref: g2news1.google.com comp.lang.ada:157 Date: 2008-05-17T15:30:17+01:00 List-Id: On Fri, 16 May 2008 10:44:11 -0700 (PDT), "jhc0033@gmail.com" wrote: >I'm mostly soliciting answers from Ada programmers who know C++ RAII >well (Skip this if you use the words "C" and "C++" interchangeably, >please. Your answers will be misleading at best): Thank you for mentioning RAII. Not associating the acronym with the concept, this prompted me to read about it, and from there to auto_ptr. Which explained to me how changing from ptr to auto_ptr (presumably to make code safer!) can introduce a spectacularly silly bug, completely statically determinable, but which the compiler allows just fine and lets the code die with a segfault. One thing is clear to me: if you attempt to replicate C++ paradigms (as opposed to OOP paradigms) in Ada, you will probably find Ada difficult. But if you appreciate that about half the patterns in the "Gang of Four" book only exist because of defects in C++, you will probably have an easier time of it. And no, I clearly do not consider myself a C++ programmer, but I sometimes have to update something left behind by someone who did. - Brian