Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!xanadu!roger From: roger@xanadu.com (Roger Gregory) Newsgroups: comp.lang.c++ Subject: Re: Smart Pointers -- A proposed language extension Message-ID: <1991Jan30.002612.27260@xanadu.com> Date: 30 Jan 91 00:26:12 GMT References: <6290@exodus.Eng.Sun.COM> <3452@lupine.NCD.COM> Organization: Xanadu Operating Company Lines: 45 > rfg@NCD.COM (Ron Guilmette) >+ tom@ssd.csd.harris.com (Tom Horsley) >+Just to throw some more dust around the smart pointer issue :-) >+ >+It seems to me that what the "smart pointer" proposals all boil down to is a >+request for language support to prevent programmers from using something >+"improperly". I believe the general consensus throughout this discussion has >+been that garbage collection and smart pointers are possible now, but to use >+them effectively you have to employ somewhat restrictive coding standards >+which are easy to unintentionally violate. We do this routinely >+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. I contend that this gives us extended type checking OUTSIDE the compiler, just as C originaly had lint to do aditional checking we can just declare that we will not use code that doesn't pass xlint. I could even have make enfoarce this if I wanted to, I don't. The last thing that we thought we required C++ to do that wasn't in the ARM has recently been finessed, though if we could wish for a way to make smart pointers that polymorphize properly, we make do with some hackery. -- Roger Gregory Xanadu Operating Company (415) 856-4112 x113 roger@xanadu.com