Namespace-Qualified Types

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

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

Comments
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.

Example

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

w

Connecting to %s