Do you think that C++ api structured by nested namespaces are a good thing?
Or do you see its just useless typing and it should rather have a prefix or something?
Or do you think that one or two levels are just fine?
What do you think?
I personally think that C++ namespaces are there to prevent conflicts between other api´s and for nothing else. But for medium to large size api´s one nested level is fine.
Too long: my::IO::Path::Combine(my::IO::Path::GetHome(), my::IO::Path::ExtractFileName(...));
Fine: my::Paths::CombinePath(my::Paths::GetHomePath(), my::Paths::ExtractFileName(...));
Better (using namespace my): Paths::CombinePath(Paths::GetHomePath(), Paths::ExtractFileName(...));
↧