Automatic invariant generation

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 11:26:43 PDT 2017


On 7/9/2017 6:37 PM, Jonathan M Davis via Digitalmars-d wrote:
> For some assertions, having more than a file and line number is nice (e.g.
> if you have messages for your pre-condition assertions, then you can make it
> so that when it fails, the programmer doesn't even need to look at the
> source code),

He always needs to look at the source code. Asserts are for BUGS, and to fix 
bugs, you gotta look at the code. If asserts are being used as a substitute for 
input/environment errors, they're misused.

In 40 years of asserts, I can't think of ever not visiting the file/line where 
it failed as the first thing I did to debug it.


More information about the Digitalmars-d mailing list