This may be a dumb question – but why are shared methods availible on types and instances in VB.net – am I wrong to assume they are the equivalent to C# static methods?
i.e
MyClass.MySharedMethod() dim mc as new MyClass() mc.MySharedMethod()
Why am I allowed to do this? What possible advantage is there to this – all I can see this doing is confusing people when using intellisense. I’m sure this has to do with some convention from classic VB6 by why bother bring this up to .NET – it just seems so broken to me.
Yes, it’s basically a hangover from VB6. Java lets you do this too, but most IDEs warn you these days I believe.
And yes, it’s a really bad idea. The most obvious example of it being bad is Thread.Sleep:
Which thread is sleeping? The current one. Doh!