Is this probably a stupid question? Sure, but i'm more or less just curious to hear other peoples opinions. So Is there a benefit to using the full reference path for an object declaration? MSDN only seemed to mention that it might help when overloading controls or declaring your own class that is already included in the visual basic language.
What i'm referring to is a declaration like so
Dim MyFile As New System.IO.File
Dim MyFile As New File
One of the reasons this exists is to solve name conflicts.
For example: Lets say you have a class:
and another class:
If you import both namespaces (
CompanyTwo.ProductY), and then declare a
Customer object, you'll get a compile-time error. It won't know which
Customer object you were trying to instantiate.
So to resolve this you would use the fully-qualified name of the class to declare your variable.