Joe Strout wrote:
Right, sure, you can write your own assertions; like this:
#if DebugBuild
Assert(x = y)
#endif
Leave out the #if and #endif, and it will be both better (assertions
should be in the final product in almost all cases) and more readable.
With all due respect, then the assert is not an assert, it is a
real error check. You are failing to acknowledge what has been
said in how asserts should work because of your own personal
coding style. The traditional usage of the assert is the correct
usage which means we should be able to have them compile at the
developer's discretion (without having to wrap them in #if
statements).
It's also not clear to me how RS could write this Assert method for
you. I'm quite sure they don't know what I want it to do, since in
different projects I may have it do different things. One client
wants
it to display a message box; another wants it to use
System.DebugLog; a
third wants the error written to their own log file. If they were to
implement it, what makes you think they would choose whatever
functionality you happen to prefer?
It is simple, the assert method calls an event and the developer
handles it there.
Joe you were part of the problem at RS when you worked there
because of this misguided attitude regarding asserts. Since you
don't work there any more, perhaps things have changed on this
issue. If RS's stance reflects your attitude upon the issue, then
we will never get a proper assert implementation simply because
they wish to enforce a particular development style upon us for
our own good.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>