From owner-freebsd-hackers Tue Mar 3 11:14:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA09087 for freebsd-hackers-outgoing; Tue, 3 Mar 1998 11:14:25 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA08921 for ; Tue, 3 Mar 1998 11:13:55 -0800 (PST) (envelope-from dag-erli@ifi.uio.no) Received: from gjallarbru.ifi.uio.no (2602@gjallarbru.ifi.uio.no [129.240.64.133]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with ESMTP id UAA19115; Tue, 3 Mar 1998 20:13:40 +0100 (MET) Received: (from dag-erli@localhost) by gjallarbru.ifi.uio.no ; Tue, 3 Mar 1998 20:13:39 +0100 (MET) To: Michael Hancock Cc: Niall Smart , FreeBSD Hackers Subject: Re: cshort - speaking of new utilities References: Organization: Gutteklubben Terrasse / KRST / PUMS X-url: http://www.stud.ifi.uio.no/~dag-erli/ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit From: dag-erli@ifi.uio.no (Dag-Erling Coidan Smørgrav) Date: 03 Mar 1998 20:13:39 +0100 In-Reply-To: Michael Hancock's message of "Fri, 27 Feb 1998 10:40:18 +0900 (JST)" Message-ID: Lines: 25 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Michael Hancock writes: > On Thu, 26 Feb 1998, Niall Smart wrote: > > > int > > > foobar(a) > > > int a; > > > REQUIRE(a > 0); > > > ENSURE(retval < 100); > > > > Ugh, do you really use this precondition stuff? > > Sure. It beats writing specs and they're kept up to date. If you were > really pedantic about it every time you looked at a piece of code without > preconditions you would say, "Anything goes". This code is telling me > that I can give it whatever I want as arguments. AOL. Plus - can you *prove* that your code is correct? No you can't, not without a suitable specification. And sometimes it is extremely useful to be able to prove your code is correct, especially stuff lik complex ADTs, or protocols. I ought to know - I teach this stuff at the Univeristy of Oslo... -- "I have a closed mind. It helps keeping the rain out." (Michael Press on a.s.r) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message