From -4508988205684383835
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ccbfcafab96cf493
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-12-05 15:22:02 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: Wed,  5 Dec 2001 23:21:04 GMT
Organization: http://groups.google.com/
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <7dc3b1ea.0112051131.3256045@posting.google.com>
References: <3BFE97B3.91430FB1@wanadoo.fr> <T23N7.64$%j1.23498@news11-gui.server.ntli.net> <3C058126.36357A00@acm.org> <7dc3b1ea.0111300954.186f1ff5@posting.google.com> <3C094998.F387ABB1@acm.org> <7dc3b1ea.0112040358.1ab543ba@posting.google.com> <3C0D2BD7.C58D005E@acm.org>
X-Trace: mail2news.demon.co.uk 1007594471 mail2news:9815 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: 5 Dec 2001 19:31:10 GMT
Lines: 51
Xref: archiver1.google.com comp.std.c++:8506

Pete Becker <petebecker@acm.org> wrote in message news:<3C0D2B51.3E77E5BA@acm.org>...
> Peter Dimov wrote:
> > 
> > To give an example: making a class abstract is enough, in current C++,
> > to prevent instantiation. I don't _need_ to test whether the class can
> > be instantiated, copied, sliced to, because I've already taken care of
> > this. This probably makes me a bad programmer by your definition
> 
> Not by my definition. Please don't attribute positions to me that I do
> not hold.

Sorry.

Pete Becker <petebecker@acm.org> wrote in message news:<3C0D2BD7.C58D005E@acm.org>...
> Peter Dimov wrote:
> > 
> > Similarly, tagging the overrider with 'override' will ensure that a
> > whole class of errors become the responsibility of the compiler, not
> > the programmer. The keyword is, in essence, my unit test for the
> > problem.
> 
> A whole class of unimportant errors which do not currently require any
> specific test to detect, becuase they become immediately obvious with
> any reasonable test set. So this keyword does not simplify testing, it
> merely complicates the language.

No, I don't agree. Calling the wrong virtual function is sometimes not
immediately obvious, even with a reasonable test set. An example would
be a virtual function that is supposed to handle WM_POWERBROADCAST or
whatever the name of that message is.

> Once again: how many times has this happened to you?

Never, IIRC. Every good C++ programmer (hopefully) knows how to avoid
the well known deficiencies of the language.

The question is not how many times has this happened to me, though.
The real question is, how much time have I lost checking signatures. I
don't consider this productive, so I _think_ that 'override' passes my
cost/benefit test. Of course this is a sample of one.

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



