I have observed that in C++ namespaces are very rarely used while in .Net it is very common. Is there any particular reason for this.
Also i would like to know if others have seen namespaces being used commonly in C++.
EDIT: Actually i am referring to custom applications and not standard libraries like STL or any other thing.
In C++, namespaces were added to the language some time after the initial implementation, so there was much application code that didn't use them. So, also due to their late addition, all of the standard library was put into one namespace. Hence with a simple using namespace std;
you could pretty much ignore namespaces if you wanted to.
In C#, on the other hand, namespaces were involved from the very start, and the library was divided out over a large number of them. Further, the Wizards everyone uses to create their initial code, put the classes into a namespace by default. This forced a much greater awareness of namespaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With