Re: info/CWS slidecopy : ENSURE_OR_CONTINUE/BREAK
Christian Lippka <[email protected]> Mon, 03 May 2010 10:13:52 +0200
| Newsgroups | gmane.comp.openoffice.announce.interface |
|---|---|
| Message-ID | <[email protected]> |
Am 29.04.2010 21:28, schrieb Stephan Bergmann: > On Apr 29, 2010, at 10:38 AM, [email protected] wrote: >> >> >> Type: info >> Title: ENSURE_OR_CONTINUE/BREAK >> Posted by: [email protected] >> Affected: - >> TaskId: i111236 >> <http://www.openoffice.org/issues/show_bug.cgi?id=111236> >> Effective from: CWS slidecopy >> CWS: >> <http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300/slidecopy> >> CWS status: new >> >> >> *Summary* >> -------- >> tools/diagnose_ex.h: >> + ENSURE_OR_CONTINUE >> + ENSURE_OR_BREAK >> >> *Description* >> ------------- >> Complementing the existing ENSURE_OR_RETURN(_*) macros in >> tools/diagnose_ex.h, which check a condition, and assert/return in >> case of failure, ENSURE_OR_CONTINUE/BREAK have been added to the same >> include file, which, guess, do a "continue" or "break" when the given >> condition is not met (after asserting it). > > Defensive programming, eh? Please don't. (Look up the arguments against it in Bertrand Meyer's OO tome, for example. "Defensive programming appears [...] to cover up for the lack of a systematic approach by blindly putting in as many checks as possible, furthering the problem of reliability rather than addressing it seriously.") Defensive programming? Please DO! I have yet to find a customer reported problem that was caused by defensive programming. On the other side I know (not guess, I know, we have numbers) how many crashes we already fixed by Defensive programming. Christian.