C++, static vs. namespace vs. singleton
As noted, using global variables is generally bad engineering practice, unless absolutely needed of course (mapping hardware for example, but that doesn’t happen THAT often). Stashing everything in a class is something you would do in a Java-like language, but in C++ you don’t have to, and in fact using namespaces here is a superior … Read more