From -5892605941225523616
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,176c9dc06a6729eb
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-03-27 11:43:04 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Scott Robert Ladd" <scott@coyotegulch.com>
Newsgroups: comp.std.c++
Subject: Re: why doesn't delete NULL the pointer?
Date: Wed, 27 Mar 2002 19:42:43 GMT
Organization: RoadRunner - TampaBay
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <BZoo8.4$K52.338@typhoon.tampabay.rr.com>
References: <a7j7vg$78s$1@watserv3.uwaterloo.ca> <3C9DD892.94860335@acm.org> <a7lhfq$co1$1@eeyore.INS.cwru.edu> <EmhE+IDVkln8Ewj$@robinton.ntlworld.com> <3C9F938C.5060805@animats.com>
X-Trace: mail2news.demon.co.uk 1017258167 mail2news:17880 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Date: Wed, 27 Mar 2002 14:22:09 EST
Lines: 46
Xref: archiver1.google.com comp.std.c++:10251

"John Nagle" <nagle@animats.com> wrote

> Handles and smart pointers don't work very well in C++.
> The language doesn't support them adequately.  Even
> the simplest case, auto_ptr, can't be made safe.
> People have tried hard on that one, and the
> semantics of auto_ptr we have now are, at best,
> mediocre.

Precisely the point I was making the other day to some coworkers who wonder
why I don't use smart pointer types. In my experience, smart pointers in C++
add as many problems as they solve (including the fact that there are many,
many semantic variations on the theme). I'd rather rely on encapsulated
resource management and "smart" programmers. However, I was hoisted by my
own petard when we discovered that one of our developers wasn't all that
"smart."



> The C/C++ attitude that the language and compiler
> have no responsibility for memory integrity is the
> single largest cause of production defects in programs
> today.  Look at Bugtraq.   It's also one of the main
> motivators for transitioning to Java and various
> scripting languages.

Very true; an excellent programmer with professional skills will not make
memory management errors. However, I've just spent two days digging out
memory allocation errors in code written by someone with 15 years of "C++
experience". In my experience, there just aren't that many "professional"
programmers -- and that's why we have dumbed-down versions of C++ called
Java and C# (neither of which, BTW, are immune to memory corruption
problems).

--
Scott Robert Ladd
http://www.coyotegulch.com
No ads -- just info, algorithms, and very free code.


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



