On 7/29/2014 12:00 AM, Dicebot wrote:
On Tuesday, 29 July 2014 at 06:35:06 UTC, Daniel Murphy wrote:
The idea is you test your code with assertions enabled, and then only use
'-release' when you are sure your program functions correctly.
If you are doing critical work or do not trust program input, either do not
disable assertions or use a tool like enforce that does not get disabled in
release mode.
This is what makes D design by contract almost useless when writing network
services :( Unless you have 100% code coverage (and I mean literally 100%) you
can't be sure enough to disable assertions with arbitrary user input. And even
if you have full coverage you still can't be sure
You can choose to disable assertions with a switch, or not. Having a choice up
to you doesn't make it useless.
Also, assertions are not for validating user input.