Good Contract programming idiom?

Lionello Lunesu lio at lunesu.remove.com
Wed Mar 3 05:54:44 PST 2010


On 2-3-2010 20:44, bearophile wrote:
> What do you think? Do you agree that's better to use exceptions like this to test arguments in public methods (instead of using asserts in preconditions)?

I agree with you. I also prefer exceptions for illegal argument values.
I test them with asserts only in private methods.

L.



More information about the Digitalmars-d mailing list