<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 4 August 2015 at 00:54, Walter Bright via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 8/3/2015 8:50 AM, Steven Schveighoffer wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
1. They aren't removed, they are replaced with a nearly useless segfault.<br>
</blockquote>
<br></span>
Not useless at all:<br>
<br>
1. The program does not continue running after it has failed. (Please, let's not restart that debate.<br>
2. Running it under a debugger, the location of the fault will be identified.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2. If we are going to put something in there instead of "assert", why not just<br>
throw an error?<br>
</blockquote>
<br></span>
Because they are expensive.<br>
<br>
To keep asserts in all their glory in released code, do not use the -release switch.<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">I think as a guideline, there are really only be two places where using an assert makes sense in druntime/phobos.<br><br></div><div class="gmail_extra">1. Internal modules, such as rt and core.internal.<br></div><div class="gmail_extra">2. Inside contracts (in, out, invariant) or unittests.<br><br><br></div><div class="gmail_extra">Everywhere else - *especially* if it's part of a public API like core.time - you should throw an Exception or Error based on what you see fit.<br><br></div><div class="gmail_extra">Because of this view, I'm not really in agreement with the addition of a core.abort module.<br><br></div><div class="gmail_extra">Regards<br></div><div class="gmail_extra">Iain<br></div><div class="gmail_extra"><br></div></div>