So there is a bit of a debate raging over in the D Language forums on a assert semantic change proposal.
But that isn’t what I want to discuss here.
I have just realized this makes a perfect job interview question….
“In the last program you wrote, would you be comfortable if the optimizer relied on the assert expressions you wrote being true, even if they were compiled out of the code?”
Why? Because your answers are going to tell me so much about your coding style and experience.
The meaning and use of assert’s is subtly ill defined, so there actually is no One True Right answer.
Oh for sure, if you follow that thread you will see my own behaviour falls sharply on one side…. but that doesn’t mean I’m Right… merely I that I have a particular style of programming.
I really like this question as there is no correct answer, and the reasons you state for your answer tells me about you, and your experience, nothing else.