Why is D unpopular?
Walter Bright
newshound2 at digitalmars.com
Sat May 21 03:05:08 UTC 2022
On 5/19/2022 11:40 PM, Tejas wrote:
> Isn't the advice to use `enforce` for handling/verifying input in release builds
> and `assert` for development builds though?
> Yeah, it's violating DRY if a particular check needs to be done in both
> development and release, but then one can skip the `assert` and just do
> `enforce`, no?
Asserts are *not* for validating program input. Please do not use them for that.
They are for checking that the program's logic is correct. If an assert is
tripped, it is a bug in the program, not a problem with user input.
More information about the Digitalmars-d
mailing list