Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

basic question on C# - do I need a namespace?

Tags:

namespaces

c#

I am a Java developer, totally new to C#. I am currently writing a DLL for distribution across my organization. It is a very simple library containing a couple of classes and I do not see any real use in putting all of them into some namespace just for the sake of it. Do I really have to use a namespace? If so, why? Is it some kind of a best practice?

like image 725
Aadith Ramia Avatar asked Sep 20 '10 10:09

Aadith Ramia


1 Answers

Do you need one? No. Should you have one? Yes. It'll help prevent clashes with identically named classes in other namespaces without having to resort to the (IMHO) ugly use of global::.

like image 57
Dave D Avatar answered Sep 18 '22 23:09

Dave D