Why no contracts for release build?

Andre via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 4 06:48:05 PDT 2014


Am 03.06.2014 23:43, schrieb Sean Kelly:
> I think the problem is that "release" is a misnomer, because the
> presence of contracts has nothing to do with whether you're
> deploying a test or release build.  For all the talk of how we
> should be profiling our code to find the trouble spots instead of
> prematurely optimizing, the release flag, by virtue of its name,
> exists as a giant red button we're all expected to press for
> "performance" or whatever before deploying our software for use
> in the first instance where safety actually matters.
>
> As for the idea that contracts simply aid in finding logic errors
> during testing... for testing to have any validity the test must
> be performed on the same build that will be released to the
> public.  And the idea that testing will ever find all the
> problems that might occur in the field is laughable.
>
> In short, pretend "release" says something like "unchecked" and
> think hard before actually setting it in real code.

Yes you are right. For my product "released" to customer, as business 
application developer, I am more focused on safety and less on performance.
If in any case a customer is doing s.th which can be caught by contracts
then it should be caught. Therefore the release switch is really dangerous.

What I really want is a switch "stable", which contains all safety 
relevant features like Contracts/Asserts and so on. But this build 
should exclude debug information etc.

I currently wonder what is included by adding no switch to DMD?
 > dmd main

Kind regards
André


More information about the Digitalmars-d mailing list