Jason House wrote:
I'll gladly add assert(0) if my complex logic confuses the compiler.
Actually, it pisses me off when the current dmd compiler complains
about an assert(0) being unreachable.
I'd love it if an unreachable assert(0) were a special case.
At the start of programming, the code is in serious flux, and many times
it would be really handy to have a few extra asserts around. Once the
code crystallises you remove the most blatant asserts.
I do this in shell scripting, too. For example, in the original rdmd
there still is a check that essentially says "if we get here, abort with
a message 'logic failure, check code'."
Of course, there are people who simply have such a clear head that they
essentially have the entire source file figured out before they start
typing. I have some such friends. They would not need this feature. But
there's some code even in Phobos that looks like it could use this.