global-namespace

Should we be teaching beginners to use a global namespace?

NOTE: I am pretty much a beginner myself. This question concentrates on C++ usage, since that is the only language I have experience with. There seems to be a consensus on Stack Overflow to use using namespace std; in the code examples provided for C++. I originally learned it this way, and was never taught WHY this is a problem later o...

How can I inject Javascript (including Prototype.js) in other sites without cluttering the global namespace?

I'm currently on a project that is a big site that uses the Prototype library, and there is already a humongous amount of Javascript code. We're now working on a piece of code that will get "injected" into other people's sites (picture people adding a <script> tag in their sites) which will then run our code and add a bunch of DOM elem...

How to force a C# root namespace throughout project files for when none is coded?

I want to force a root namespace on the contents of any .cs source files that don't have their contents wrapped in an explicit namespace. In other words I want to keep classes and other namespace-level structures out of the default namespace. (Working inside a Windows .NET environment with Visual Studio) In the following example, I want...

Doxygen/C++: Global namespace in namespace list

Hi, Can I show the global namespace in the namespace list of the documentation generated with Doxygen? I have some functions which are extern "C", they appear in the documentation of the header file that declares them, but not in the namespace list and it gives the impression that they are not really there... ...