Re: Opinions on Programming by Contract

This is a discussion on Re: Opinions on Programming by Contract within the Eiffel forums in Programming Languages category; On 16 Jun, 21:26, James Harris <james.harri...@googlemail.com> wrote: > My language design includes a "validation" section at the top of > functions to vet the input values. This has a number of benefits but > was initially included for and is especially useful for remote > procedure calls: the validation can run on the caller and thus > immediately trigger a parameter exception without the latency of > having to contact the remote process. So the sequence is > > caller --> validation --> callee > > where the validation is written in the callee code but where it runs ...

Go Back   Application Development Forum > Programming Languages > Eiffel

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-18-2008, 05:50 AM
James Harris
Guest
 
Default Re: Opinions on Programming by Contract

On 16 Jun, 21:26, James Harris <james.harri...@googlemail.com> wrote:
> My language design includes a "validation" section at the top of
> functions to vet the input values. This has a number of benefits but
> was initially included for and is especially useful for remote
> procedure calls: the validation can run on the caller and thus
> immediately trigger a parameter exception without the latency of
> having to contact the remote process. So the sequence is
>
> caller --> validation --> callee
>
> where the validation is written in the callee code but where it runs
> is unspecified. It can be run in the caller before the parameters
> leave the caller's context.
>
> I've just spent a couple of hours looking at Eiffel which does
> something similar called Design by Contract. Under Eiffel my
> construct, above, would be called a precondition. My question is:
>
> Is it worth including in a language postconditions and class (or any
> other) invariants? I'd be interested in the views of other programmers
> and language designers.
>
> --
> James
>
> Background:http://en.wikipedia.org/wiki/Design_by_contract
> Presentations:http://archive.eiffel.com/doc/manual...logy/contract/
>
> Chris Hoare's base theory:http://en.wikipedia.org/wiki/Hoare_logicis
> somewhat hard to follow, IMHO.


Widening the net a bit to include comp.lang.eiffel. Presumably folks
there like all three parts of the DbC feature. There are other
comments (currently six replies) in the original groups in case anyone
from c.l.e want to see them and agree with or rail against them!

I can't help wondering if there are other places where asserts should/
could be used. Perhaps Chris Hoare's base theory just proposes these.
In fact pre and post conditions may be all that's required by the
theory. The invariants automatically apply at both times.

--
James
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:12 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.