Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!caen!uflorida!gatech!mcnc!decwrl!infopiz!lupine!rfg From: rfg@NCD.COM (Ron Guilmette) Newsgroups: comp.lang.c++ Subject: Re: Smart Pointers -- A proposed language extension Message-ID: <3706@lupine.NCD.COM> Date: 4 Feb 91 22:08:05 GMT References: <3452@lupine.NCD.COM> <1991Jan30.002612.27260@xanadu.com> Organization: Network Computing Devices, Inc., Mt. View, CA Lines: 40 In article <1991Jan30.002612.27260@xanadu.com> roger@xanadu.com (Roger Gregory) writes: > >>+Given this, could the smart pointer question be considered an "environment" >>+issue rather than a "language" issue? Could a sufficiently sophisticated C++ >>+development environment provide the sort of additional semantic checks >>+needed to insure that no one ever used a class "improperly"? >> >>I want to refute this as strongly as possible. NO!!! This has nothing >>to do with environments! Type-checking is one way that the compiler >>can restrict you from shooting yourself in the foot. Is type-checking >>an environment issue? NO WAY! > >I disagree, type checking certainly can be made into an environmental >issue, consider a c++lint powerful enough to check c++ code for >various eccentric restrictions (we call ours xlint). This enables >us to check lots of restrictions, though all possible sources of >errors. OK. Let me re-phrase my statement. Type checking, as well as numerous other sorts of checking for "correctness" of C or C++ programs *may* be incorporated into a tool which you don't call a "compiler", however that is often a foolish implementation technique. I consider it to be a fundamental part of the job of a "compiler" to perform a good deal of "checking" on the programs (or sub-hunks of programs) that I feed it. Placing some of the checking into a separate tool is like inviting somebody to write crappy code. If you don't believe that, try running lint on some big hunks of code where the original developer decided not to be bothered with trivia like using lint during the initial development. Most likely you will be horrified by what you find. -- // Ron Guilmette - C++ Entomologist // Internet: rfg@ncd.com uucp: ...uunet!lupine!rfg // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.