- Home /
Why should we don't use namespace?
The Unity Script Reference states: "5. Don't use namespaces. Unity doesn't support placing your scripts inside of a namespace at the moment. This requirement will be removed in a future version." (http://docs.unity3d.com/Documentation/ScriptReference/index.Writing_Scripts_in_Csharp_26_Boo.html)
My question is, why!?
I'm currently using them and have absolutely no problems. I've searched on the web and I'm not able to find a good reason why not using them. I would like to have more details abou that!
P.S I'm using Visual Studio 2010 to develop, which manage namespace better then MonoDevelop.
Thanks!
Answer by Dave-Carlile · Feb 11, 2013 at 05:16 PM
I don't see any issue with using them, but they're not necessarily honored. If you have a class with the same name as a Unity class for example, Unity can't tell them apart unless you qualify it with the entire namespace. At least that has been my experience.
I didn't made the test. But now that I test it, it's true. Unity doesn't manage the fact that 2 class has the same name but in different package.
For comprehension and in sake of good practices, I'll keep them.
Thanks!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Problem with referencing namespaces C# 1 Answer
how to access script not derived from monobehavior ? 1 Answer
Nested Namespaces 2 Answers