So I was reading over the MSDN docs and came across:
http://msdn.microsoft.com/en-us/library/sf0df423.aspx
What is a practical use of using an alias for using directives?
I get what is does, I just dont get WHY I could want to use it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s useful if you have a class of the same name in two different namespaces. When that happens you have two choices.
usingone namespace and not another (meaning use the fully qualified name for the other one), orusingone namespace normally andusinganother with an alias. Since the alias is shorter than the fully qualified name it’s still easier and more convenient.Obviously the best option is to just not have public classes of the same name in different namespaces, especially if there’s any chance someone would want to use both in the same class.