Re: request for change
- Posted by Matt Lewis <matthewwalkerlewis at ?ma?l.com> Jan 08, 2008
- 621 views
Bernie Ryan wrote: > > 'without warning' is used by lazy programmers that don't > want to be bothered with cleaning up their programs by > removing unused variables. Yes, that happens, but not always because the programmer is lazy. There are many times that unused variables can't be removed, like when they are part of an event handler callback, and the processing doesn't need to use all of the parameters. Or it could be that the warning is about a possible short circuit in an if statement, where that is exactly what the programmer wants. There's also the case of unused global constants that are part of a library, and so might be used by clients (or not, but that's not a good reason to eliminate them). Of course, the better solution for that is to put without warning at the bottom of the file. In any case, your argument doesn't support changing the defaults. It's the equivalent of, "Some people abuse this, so let's just give up and stop issuing warnings at all." I think it's better to require affirmative action from the programmer to turn off the warnings. If we had multiple levels of warning, then we could debate about the proper default warning level, but since we only have one, I think it's obvious that the default should be to have warnings on. Matt