Invariant and pre/post-conditions order

Jonathan M Davis jmdavisProg at gmx.com
Thu Jan 19 21:54:19 PST 2012


On Thursday, January 19, 2012 21:31:14 Walter Bright wrote:
> I'm not going to swap them without a compelling demonstration of its
> advantages. Not breaking much code is not an argument for changing current
> behavior.

I'm not saying that it is. I'm just saying that breaking code should not be a 
reason _not_ to change the current behavior. Whether we change it should be 
based on other arguments.

Bearophile and Steven are arguing that it makes debugging easier when it's the 
post-condition that fails rather than the invariant when they would both fail. 
If that's really true, then there's definitely merit in switching, but I'm not 
sure how much it would really help. We really need examples showing how it 
will affect debugging.

- Jonathan M Davis


More information about the Digitalmars-d mailing list