W
William E. Rubin
Regardless of what the example does, my point is, how should it warn you?
By saying "foo might be undefined at line 2351".
When you ask it to. I'm not saying that such warnings should be output
by default.
Assuming that you asked it to, then yes. Or, potentially, there could
be a way to state, within the source code, for the benefit of this new
tool, that "Yeah, I already know that it looks like 'foo' might be
undefined on the next line (or in this function, or in this file).
Don't bother telling me about that".
I agree.
Then don't use it in such cases. Or, if you find it useful in some
complex case except for such annoyances, use it, but invoke the "Yeah,
I know" option described above.
By saying "foo might be undefined at line 2351".
When?
When you ask it to. I'm not saying that such warnings should be output
by default.
If it worked just by looking at whether it _may_ be undefined, then
surely it'd always warn you in the above situation?
Assuming that you asked it to, then yes. Or, potentially, there could
be a way to state, within the source code, for the benefit of this new
tool, that "Yeah, I already know that it looks like 'foo' might be
undefined on the next line (or in this function, or in this file).
Don't bother telling me about that".
I can see that it would probably help in a lot of cases
I agree.
but it would be
an annoying gripe in a lot of the more complex cases, which is where Ruby
shines.
Then don't use it in such cases. Or, if you find it useful in some
complex case except for such annoyances, use it, but invoke the "Yeah,
I know" option described above.