Hi Kees,
It's mostly about better organizing/structuring the code and avoiding conflicts. In .Net there are probably millions of classes available to use, and without using different namespaces for them, there would certainly be a lot of classes with the exact same name. If you want to not use a namespace at all for your classes this is fine, but it will make it very difficult for others to use a library of yours, if you care about this.
Another thing that namespaces help with, is intellisense support, as you can group together classes that have common functionality. For example you can use a namespace like DbfStuff for all your classes that deal with databases and you do not need to remember the names of related classes, you can just type "DbfStuff." in the editor, and intellisense will show you a list of all related classes that you may want to use. If you create proper namespaces for grouping, this can be very helpful if you have a lot of classes in your code.
Miscellaneous questions about converting VO code to X#
Re: Miscellaneous questions about converting VO code to X#
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Miscellaneous questions about converting VO code to X#
Hi Kees,
I do not know how this works in Visual Studio, but in XIDE you can set a common namespace for yor entire assembly, so you do not need to set the namespace for every program file.
Wolfgang
I do not know how this works in Visual Studio, but in XIDE you can set a common namespace for yor entire assembly, so you do not need to set the namespace for every program file.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it

