From 8800965000908838722
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ccbfcafab96cf493
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-12-06 10:43: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: pdimov@mmltd.net (Peter Dimov)
Newsgroups: comp.std.c++
Subject: Re: Proposol to increase robustness of programs
Date: Thu,  6 Dec 2001 18:42:11 GMT
Organization: http://groups.google.com/
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <7dc3b1ea.0112060840.69c166cc@posting.google.com>
References: <3BFE97B3.91430FB1@wanadoo.fr> <T23N7.64$%j1.23498@news11-gui.server.ntli.net> <3C058126.36357A00@acm.org> <EKwN7.1910$V51.448065@news11-gui.server.ntli.net> <3C06A0CE.E91638E8@acm.org> <Tb5O7.940$003.235141@news11-gui.server.ntli.net> <3C0C1E25.1A0247AD@acm.org> <3C0D410B.7198B21D@wanadoo.fr> <3C0D4878.A86E882E@acm.org>
X-Trace: mail2news.demon.co.uk 1007664136 mail2news:21163 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)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Date: 6 Dec 2001 16:40:09 GMT
Lines: 54
Xref: archiver1.google.com comp.std.c++:8517

Pete Becker <petebecker@acm.org> wrote in message news:<3C0D4878.A86E882E@acm.org>...
> Lo? Joly wrote:
> > 
> > Pete Becker wrote:
> > >
> > > Jim Barry wrote:
> > > >
> > > > I don't agree that this is an issue that only affects novices.
> > >
> > > How often have you had a problem because you changed a virtual functi
>  on
> > > to non-virtual?
> > 
> > I am not sure you read my latest answear, so I repeat it : The proble i
>  s
> >  NOT  changing a function from non virtual to virtual. The problem is
> > making a modification to one parameter of the base virtual function, an
>  d
> > not applying the same modification to the derived function.
> > 
> 
> Fine. How often have you had a problem because you made a modification
> to one parameter of the base virtual function, and didn't apply the same
> modification to the derived function?

After changing a base virtual function signature, the typical
procedure is to locate all overriders - by hand - and fix them. Rarely
does a programmer wait for the tests to fail. They will. No new
information would be gained.

With consistent use of 'override', the process is automated.

There are ways in current C++ to achieve the same level of error
checking (never override a non-pure virtual) but unfortunately they
can't be applied universally.

> Of course, the same sort of
> problem can arise with overloading -- if you modify one parameter you
> can change which version gets called by other code. Do you also have a
> proposal for fixing that?

A solution for this problem would likely have a different cost/benefit
ratio.

--
Peter Dimov
Multi Media Ltd.

---
[ 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                ]



