From -8358014326104421640 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,ccbfcafab96cf493 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2001-12-07 09:31:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: Pete Becker Newsgroups: comp.std.c++ Subject: Re: Proposol to increase robustness of programs Date: Fri, 7 Dec 2001 17:30:42 GMT Organization: Dinkumware, Ltd Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: <3C10D01A.BF943821@acm.org> References: <3BFE97B3.91430FB1@wanadoo.fr> <3C058126.36357A00@acm.org> <3C06A0CE.E91638E8@acm.org> <3C0C1E25.1A0247AD@acm.org> X-Trace: mail2news.demon.co.uk 1007746248 mail2news:5534 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) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Date: 7 Dec 2001 14:19:41 GMT X-Accept-Language: en Lines: 48 Xref: archiver1.google.com comp.std.c++:8539 Jim Barry wrote: > > Pete Becker wrote: > > How often have you had a problem because you changed a > > virtual function to non-virtual? > > Sorry, when you first asked this I thought it was a rhetorical question. > The answer is that I have no idea, as I haven't been keeping count. But > I do sometimes find it necessary to modify a virtual function > declaration in order to improve a design, either during the initial > development phase or during maintenance. When that happens, it would be > rather helpful if the compiler could alert me to any overriders that > have been overlooked. Do you want 'override' to be mandatory? If it isn't, you can't rely on it. "Rather helpful" isn't the same as "should be part of the language." When someone changes something about a class, whether it's the interface or the implementation, evaluating consequential changes to other classes requires thought. Mechanical techniques that detect some places where analysis is needed but doesn't detect others isn't particularly helpful, since you have to do the full analysis regardless of what your tools tell you. Ultimately, 'override' is neither necessary nor sufficient to protect programmers from changes in base classes. Tools that only do half the job are worse than no tools, because they give misleading information. > > > How far should the language go, adding keywords (and, > > therefore, complexity) in order to protect beginners? > > Now that really does sound like a rhetorical question. > No, it's precisely the issue that this suggestion raises. -- Pete Becker Dinkumware, Ltd. (http://www.dinkumware.com) --- [ 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 ]