From -3510239660197354514
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ccbfcafab96cf493
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-12-09 11:17: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: "Marcin 'Qrczak' Kowalczyk" <qrczak@knm.org.pl>
Newsgroups: comp.std.c++
Subject: Re: Proposol to increase robustness of programs
Date: Sun,  9 Dec 2001 19:16:46 GMT
Organization: Klub Nieszkodliwych =?iso-8859-2?Q?Manjak=F3w?=
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <slrna16i32.gah.qrczak@qrnik.zagroda>
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> <7dc3b1ea.0112070704.1d8ad50f@posting.google.com> <3C11055C.899A4886@acm.org> <7dc3b1ea.0112080650.4af0bc11@posting.google.com> <3C125900.53951788@acm.org>
X-Trace: mail2news.demon.co.uk 1007925417 mail2news:461 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)
NNTP-Posting-Date: Sun, 9 Dec 2001 11:17:54 +0000 (UTC)
User-Agent: slrn/0.9.7.3 (Linux)
Lines: 56
Xref: archiver1.google.com comp.std.c++:8569

Sat,  8 Dec 2001 21:20:25 GMT, Pete Becker <petebecker@acm.org> pisze:

> Making it easy to detect some portion of a class of errors at
> compile-time encourages sloppiness: hack the code until it compiles,
> then declare it finished. What's needed is the discipline to trace the
> implications of the change through all of the code, not just to the
> places where the compiler detects a problem.

This reasoning can be applied to any mandated diagnostic and that's
why I don't believe it. What you are saying implies that it would be
better to require any text to be accepted as a valid program, with
possible erroneous behavior which would be catched by tests instead
of the compiler.

I strongly disagree. If it's possible to detect the most probable
place of a given error at compile time, it should be detected.
Programmers won't automatically become better if they have fewer
tools to use, they won't be more productive if writing tests takes
five times as long as writing code. Compilers can detect many errors
a lot cheaper than tests, more reliably, with better diagnosis about
the source of the error.

Valid arguments against adding a mechanism which detects more errors
at compile time are making the language more complex (i.e. more
learning, more verbose code, harder to write compilers). The fact
that errors are now detectable by the compiler makes no sense for me
as an argument against.

How would you judge Boost's concept checking mechanisms? They reject
code which would possibly work, but which is against the rules.

The way you advocate encourages sloppiness: hack the code until current
tests pass, no matter if the code makes sense or will be correct if
something changes. You would change a badly behaving code where the
misbehavior is catched, which is not necessarily the same place where
the error is. A compiler can detect some errors without running the
code in question: it will predict that something is wrong before you
discover a contradiction in its consequences.

If you could test everything and thus if you knew the behavior for
all inputs, you wouldn't have to write the program in the first place.
Testing is no substitute for sane design (I mean design in the small
scale).

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^
QRCZAK

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



