- Pre-conditions.
- Post-conditions.
- Consistency checks.
If a case does not meet these conditions, an exception is thrown. A developer can find problems of the program easily by an exception. And he always keeps cool because he can write down the code's spec on the source code.
"Design by Contract" is tried in many program languages. We can use it in C++? We can implement Pre-conditions with assert(). Post-conditions and Consistency checks are difficult in C++. We can get many sample codes from the internet because many programers try it in C++.
No comments:
Post a Comment