Invariant and pre/post-conditions order

Walter Bright newshound2 at digitalmars.com
Thu Jan 19 21:31:14 PST 2012


On 1/19/2012 9:14 PM, Jonathan M Davis wrote:
> Yeah, but if they're modifying state, they're doing something which is
> essentially invalid,

Yup, so arguing for which order the state changes should come in is also invalid.

> so from the standpoint of breaking code, I don't think
> that swapping the order invariants and post-conditions is really an issue. I
> think that it's just a question of which order makes more sense. If that's
> what it is now, then great, we'll leave it as-is. If it's the other way
> around, then I very much doubt that it would negatively impact much code (if
> any) to swap them, since the order really isn't supposed to matter.

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.



More information about the Digitalmars-d mailing list