The benefits of programming with assertions (a.k.a. assert statements)by Philip Guo (contact info) June 2008
Programming with assertions
(a.k.a.
assert (p != null); // can now use p without first checking if it's null
// original code snippet:
y = f(x);
// code while refactoring and testing:
assert(f(x) == f2(x));
y = f2(x);
// code after refactoring completed:
y = f2(x);
Related articles
Created: 2008-06-20
Last modified: 2008-11-15 |