Jon,
| Things which harm readability in this way really shouldn't be used.
| Personally I think it would be better as an error than as a warning,
| but I can see why changing it to an error at this stage would be a real
| problem.
I just double checked. It defaults to a warning for new projects; using the
project properties you can change it to either: None, Warning, or Error.
FWIW: There are a handful of other compile messages, such as "unused local
variable" or "recursive operator & property access", that you can set to
None, Warning, or Error which is rather nice.
Jay
| > > I couldn't agree more. Fortunately VB.NET 2005 warns you when you
attempt
| > > to call a shared (static) method as an instance method.
|
| > And that is in my opinion the right approach. (I don't like the word
| > shouldn't). Although I see not any reason why it shouldn't. (I can see a
| > reason however that is against my way of writing a program and that is
when
| > in the static/shared procedure a static/value is set).
|
| The reason you shouldn't (and I'm not afraid to use that word) is that
| it gives the wrong impression. It gives the impression that the method
| you're calling is related to the instance you appear to be calling it
| on, when that simply isn't the case.
|
| For instance, if you create a new Thread and then appear to call Sleep
| on it, it *looks* like you're somehow telling the other thread to
| sleep, when in fact it's making the current thread sleep.
|
| Things which harm readability in this way really shouldn't be used.
| Personally I think it would be better as an error than as a warning,
| but I can see why changing it to an error at this stage would be a real
| problem.
|
| Of course, it's worth always trying to write code which doesn't
| generate warnings anyway, and if you do that it doesn't really matter
| whether it's a warning or an error...
|
| --
| Jon Skeet - <
[email protected]>
|
http://www.pobox.com/~skeet
| If replying to the group, please do not mail me too