In a book i'm reading about C++ software programming called :
Large-Scale C++ Software Design
The author does not utilize namespaces at all specially that he is taking about how to use C++ for extensive, large projects
instead, he uses static classes like this:
and of course you would call them like this:Code:class HussainLib { HussainLib(); //no class instantiation meant //functions public: static void bubble_sort(int* list, int size); static void arithmetic(int x, int y, int arith); //blah blah blah //data public: static const double PI(); static const double e(); //blah blah blah };
what do you think? is it more practical than namespaces ?Code:const double PI = HussainLib::PI()
I find it a very good way to hide data and functions for programmers working together