pcnerd said:
So, I suppose that if I use "Imports System" , it will probably be a pretty
big file.
This comment suggests you might have a misconception about Imports in
VB.NET, because it is the same word as a Java keyword. Now, my Java
experience is pretty small, but am I right in thinking that in Java you
want to import only the minimum you need to, because importing actually
does something to the produced executable? Well, in VB.NET, Imports is
*entirely* syntactic sugar - all it does is allow us to use the names
of things from our References without fully qualifying them. As the
docs put it: "Importing does not take the place of setting a reference.
It only removes the need to qualify names that are already available to
your project."
For example, once we reference, say, System.dll, everything in there is
available to us whether we use Imports System or not; all the Imports
line does is allow us to refer to System.Uri as simply 'Uri' in our
code.
Note that many commonly-used namespaces are imported automatically in
newly-created projects, at the project level, so we often don't need
any Imports statements in individual files.
Of course, if you knew all this already, great!