As with regular statements, you can disable your custom statements using the convenient global constant method or variable or class. They really do not belong (active) in the production code or are active by default in any library. For what you use them, it seems like a waste of processor cycles, even if you can disable them.
In lower-level languages, assertions are very useful for catching very strange situations, such as errors created by optimizing the compiler, depending on a zealous architecture. For example, you know that in any intelligent universe, an approved condition will be true. Then your compiler tears the fabric of space and everything changes. Thus, perhaps they would be useful if you used something like PHC or Roadsend to compile your application.
I also saw "overly secure" code (mainly in C), where the entrance to each individual function is protected by statements. I really doubt the wisdom of this.
In short, you want your code to fail gracefully or not at all, and not just stop, especially if it depends on user input. Statements only report conditions that evaluate to false; they do not handle errors.
source share