using namespace name;or do you use the scope identifier:
name::somefunction();Thanks http://www.stodge.net - the powerhouse in personal commentary
using namespace name;or do you use the scope identifier:
name::somefunction();Thanks http://www.stodge.net - the powerhouse in personal commentary
quote:
Original post by Evil Bill
I tend not to use them, I think theres little point. My theory is that if theres a clash between names, the names don''t describe the object well enough.
quote:
Original post by Evil Bill
I tend not to use them, I think theres little point. My theory is that if theres a clash between names, the names don''t describe the object well enough.
quote:
Original post by Evil Bill
If it were me, i''d name my actual Application: CApplication, and if i had a choice, the NeHe one SApplication, or maybe SAppVars or something.
#include <vector>
usign namespace std;

quote:
Original post by LilBudyWizer
That is not cheating. Picture a company like Microsoft. A individual team is part of a heirarchy at least four or five levels high. So say there are groups, divisions, departments, applications and teams. So you assign each group a unique namespace. Within each group you assign each division a unique namespace and so on down to the individual team. How long is the fully qualified name going to be?
quote:
...Rather you just want the ability to resolve the conflict should one arrise.
quote:
Original post by Evil Bill
If it were me, i''d name my actual Application: CApplication, and if i had a choice, the NeHe one SApplication, or maybe SAppVars or something.
quote:
But true, if you''re wanting to produce a library or something, its probably a good idea to use a namespace, just to be sure that nothing clashes. All it takes is an extra using namespace std; in the app.
quote:
Original post by JohnBSmall
Well, most of my modules have setup, and shutdown functions. I''d hate to have to think of 10 different names for Setup, when I can just use video::Setup(), audio::Setup() and so on...
quote:
Original post by LilBudyWizer
How long is the fully qualified name going to be? Most likely at least 50 to 100 characters for semi-descriptive names. Who seriously would require their programmers to type 50 to 100 characters everytime they use a structure, class, union or enum.
namespace FooGroup
{
namespace FooModule
{
namespace FooStuff
{
typedef int Foo;
}
}
}
namespace Bar
{
namespace FooStuff = ::FooGroup::FooModule::FooStuff;
FooStuff::Foo x;
}
quote:
Original post by Oluseyi
"video", "audio" and so on are fairly common identifiers in multimedia programming; they make bad choices for namespace identifiers. I had an Audio class in my last library, but I put it within the Obsidian namespace (Obsidian is derived from my initials, and was the library internal identifier). I would need to exit to the global (unnamed) namespace before I could use your classes in a scope where my namespace had been introduced - code inconsequential, but inelegant and inconvenient.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more