Benefits and pitfalls of Using a Namespace

If you use the “Using” keyword to access a namespace, then you have constant access to all of the functions in that library. This makes your code a little cleaner since you’re not constantly typing the namespace before each command. With VS Intellisense, it also gives you access to a list of commands in that namespace if you’re ever trying to figure out how to build logic in your code and need ideas.

But of course nothing is without it’s negative consequences. Of course you’ll want to use multiple namespaces but sometimes the same command will exist within multiple libraries, though in a different variation. It will still have the same name and so the program won’t know which to use. Again you’ll have to specify which namespace you’re referring to.

Privacy & Terms