3 ms·
If the compiler is optimising code away, it's optimising away its copy of code that the diligent programmer has already written. ie. the implied assertion that
by ChoHag 10y ago
If the compiler is optimising code away, it's optimising away its copy of code that the diligent programmer has already written. ie. the implied assertion that the check is not performed at all is not true. The check is not performed twice.
Of course programmers are not always diligent but perhaps in that case a language which unconditionally demands diligence is not the right choice.
> It also adds a very subtle, exceptional case to several very common functions, burdening programmers.
Dealing with the burden of subtle and/or exceptional cases is the price of using a low-level language. If the price is unacceptable, don't buy the product.