Xref: utzoo comp.lang.c++:8922 comp.software-eng:4043 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!milano!cadillac!vaughan@mcc.com From: vaughan@mcc.com (Paul Vaughan) Newsgroups: comp.lang.c++,comp.software-eng Subject: Re: Project experience with C++ Message-ID: <10329@cadillac.CAD.MCC.COM> Date: 10 Aug 90 15:12:57 GMT References: <812@agcsun.UUCP> <222.26a42b7d@astro.pc.ab.com> <13038@yunexus.YorkU.CA> <294.26b56ac2@astro.pc.ab.com> <1030@pi19.pnfi.forestry.ca> <350.26bd5757@astro.pc.ab.com> <397.26c19b74@astro.pc.ab.com> Sender: news@cadillac.CAD.MCC.COM Reply-To: vaughan@mcc.com (Paul Vaughan) Followup-To: comp.lang.c++ Organization: MCC VLSI CAD Program Lines: 35 In-reply-to: klimas@astro.pc.ab.com klimas@astro.pc.ab.com wrote: I saw some confidential statistics on a large software project that indicated that strong typing in a rather large (~ 1 million lines of code) caught only 10% of the errors. I believe that this is an area that others' contributions would be very helpfull in sorting out the relevant issues from the noise. I'd be highly skeptical of this. Type checking catches a lot of errors in a way that gets them fixed immediately. Programmers tend to forget they even made them. It's like leaving out a semi-colon. Most people don't record that as a programming error. They just fix it. Having come from a LISP background, I find that it seemed a lot easier to modify a program in LISP, but that after having done it, bugs associated with the "fix" would keep popping up forever and stringent testing after every change was required to maintain robustness. Type checking totally eliminates most of the errors that would plague us then. On the other hand, there certainly are several categories of frequent errors that type checking doesn't help with. Memory allocation/deallocation misunderstandings come prominently to mind (ah, LISP . . .). Does anyone have any experience, intuition, or statistics concerning the use of const? Does it really help clear up errors or not? It's certainly a bag of worms to get a program const correct--it just ripples and ripples through your code and then you wind up finding a place in some library or system function where something really should have been const but can't be changed and you have to cast around it in the end. So what's the verdict is const worth it? Paul Vaughan, MCC CAD Program | ARPA: vaughan@mcc.com | Phone: [512] 338-3639 Box 200195, Austin, TX 78720 | UUCP: ...!cs.utexas.edu!milano!cadillac!vaughan