From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ad06d2d7cb045687 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Received: by 10.68.189.72 with SMTP id gg8mr13133752pbc.4.1327992422325; Mon, 30 Jan 2012 22:47:02 -0800 (PST) Path: lh20ni243892pbb.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Silly and stupid =?UTF-8?B?cG9zdOKAkWNvbmRpdGlvbiBvciBub3TCoA==?= =?UTF-8?B?Pw==?= Date: Tue, 31 Jan 2012 07:47:04 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Date: Tue, 31 Jan 2012 06:47:01 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="cJo7kSTQUrCFv2/D8KKtqw"; logging-data="8839"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OToHhoH4pBK/+ssLNLx3e" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: Cancel-Lock: sha1:owxxsUd4P32fwDWrVc/8yswDn14= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-01-31T07:47:04+01:00 List-Id: Le 31/01/2012 00:11, Yannick Duchêne (Hibou57) a écrit : > Is such a post‑condition a good or bad practice in your humble or > authoritative opinion ? > 1) There is not stupid question 2) A precondition expresses what you require from the user of your package. A postcondition is what you promise to the user. The important point is that these conditions are part of the specification - visible. Like any check (including simple constraints), conditions have no effect whatsoever on a working program (presuming such a thing exists). It helps during program development by having exceptions raised closer to the cause of the problem, and work as kinds of lemma, intermediate steps that help to make program proofs. Is this particular one useful? If you think that it is a property of your subprogram that should be made explicit to the user, yes. If you think it is just a redundant property that only repeats the properties of the specification, no. Really a matter of appreciation. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr