From 1506175006905381007
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ccbfcafab96cf493
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-12-07 17:03:04 PST
Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!194.42.224.136!diablo.netcom.net.uk!netcom.net.uk!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "James Kuyper Jr." <kuyper@wizard.net>
Newsgroups: comp.std.c++
Subject: Re: Proposol to increase robustness of programs
Date: Sat,  8 Dec 2001 01:02:20 GMT
Organization: Posted via Supernews, http://www.supernews.com
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3C116753.1ABD9C5A@wizard.net>
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> <7dc3b1ea.0112060840.69c166cc@posting.google.com> <3C0FD9D7.8F1845C4@acm.org> <3C102097.B3C1FEA8@wizard.net> <3C10CE1E.E556E183@acm.org>
X-Trace: mail2news.demon.co.uk 1007773345 mail2news:9680 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)
X-Accept-Language: en
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 71
Xref: archiver1.google.com comp.std.c++:8559

Pete Becker wrote:
> 
> "James Kuyper Jr." wrote:
> >
> > Pete Becker wrote:
> > >
> > > Peter Dimov wrote:
> > > >
> > > > 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.
> > > >
> > >
> > > No, it turns into compile-and-see-what-breaks, which is rarely a good
> > > approach to software engineering.
> >
> > I'm sorry, but I have to disagree. Compile-and-see-what-breaks is one of
> > the many important tools that belongs in every programmer's tool chest.
> 
> No. When programmers resort to this it's because they're tired of
> thinking.

I think all day long. It's what I get paid for. Getting tired of
thinking is a normal everyday event. No - make that "hourly", not
"everyday". I prefer to let the compiler spend it's exceedingly cheap
time thinking about the things that it's much better equipped to think
about than I am. I prefer to concentrate my own limited and expensive
supply of time thinking about issues that I'm much better equipped to
handle than the compiler is.
 
> > I think you're missing out on one of the most basic problems 'override'
> > helps with: spelling errors. Without 'override', a misspelled overrider
> > is a perfectly legal definition of a completely different member
> > function. If you are consistently misreading it as having been correctly
> > spelled (a mistake that's easy for human beings to make), it can be very
> > difficult to detect the problem through testing, or debugging.
> 
> Huh? If you haven't overridden a base-class virtual function, then your
> test code that exercises the derived-class overrider will fail. That's
> not at all hard: it just works.

All that unit test will tell me is that there's a problem. If I don't
notice the misspelling, that test WON'T tell me where the problem is.
This is perfectly normal, at least for those of us capable of making
spelling errors. If a person commits a particular misspelling, that
person is also likely to not notice that misspelling when reading it.
With an 'override' keyword, any decent compiler would give me a message
that points me far more precisely at the actual source of the problem.
It will do so as soon as I compile the code, without even waiting for
the unit test.

> > Compilers, on the other hand, excel at detecting that kind of error.
> > Maybe you spell perfectly, but I don't, and neither do most of the other
> > programmers I've ever worked with.
> 
> There are lots of places where this could happen. Changing the language
> to attack one that's easy to test for isn't particularly useful.

Nor is it useless. As as judgment call, I think it's usefulness is large
enough to justify the change, but I don't expect agreement on judgment
calls.

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



