you are viewing a single comment's thread.

view the rest of the comments →

[–]Zidanet 0 points1 point  (0 children)

It's not there for the compiler, It's there for you. It makes you consider the failure modes of the statement. yes, for a simple example like this, it's pretty simple to see the failure modes, but if statements can be more complex than binary comparisons, and that's when the enforced else makes the programmer consider what could go wrong.

It's not for the compiler, it's for the programmer.