Quote:
Originally Posted by Greg McKaskle
An if statement without an else has no way to specify values for the !if cases.
If(x==3) y=4;
When x isn't three, what value will y have? Perhaps y is already initialized, perhaps not, and that is an opportunity for an uninitialized variable. Sure, one x and one y and it is trivial to see, but as things scale, the structure and the usage pattern lead to a very large number of potential problems.
|
Ahh I see now. The way to solve this problem would be to enforce having an else (like the default case in the case structure), right? And if you initialize something in one place and not another, you'd have a broken wire much like a case statement would give you one.
I'm beginning to see how it might turn into a bigger problem than it solves though.