Namespace-Qualified Types

You want to know if you should use fully qualified names when working with types in your code.

You’ll want to avoid using fully qualified type names. Make statements shorter by placing using statements at the top of source files.

There’s a nice convention to follow with using statements. List all .NET namespaces first and then ones imported from third-party libraries. In addition, always list nested namespaces after their enclosing one.


using System;
using System.Timers; // Nested namespace.
using OpenQA.Selenium; // 3rd-party namespace.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s