Namespace inside a namespace? Good/Bad Practice? what u say?

Discussion about everything. New games, 3d math, development tips...
Post Reply
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Namespace inside a namespace? Good/Bad Practice? what u say?

Post by MasterGod »

Hi,
Does making namespaces inside other namespaces is a good practice? Does it make the code look ugly? Is it common?
Pros/Cons?

I'd be happy to hear your thoughts about this subject.

Thanks a lot and have a pleasant time for the rest of the day :) .
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Irrlicht

Post by 3DModelerMan »

Irrlicht does it... I don't see any problems with it.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Thanks but with all do respect for Irrlicht, not everything in it is good or good practice.
Its a good library with many good concepts applied to it but its quite mature and there are stuff from older time which is left as it is because of the phrase "if it works, don't touch it" - or however it goes..

On the other hand the developers do know what good practice is (and many others in here) and so I ask, regardless of Irrlicht code that is similar to it.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Systemerror
Posts: 98
Joined: Fri Oct 03, 2008 1:25 pm
Location: UK
Contact:

Post by Systemerror »

I think it's probably one of those things that are personal preference, I personally don't do it because I like to keep my code within it's usage, that is, if I use a namespace, I only use it if I use that namespace regularaly otherwize I would use the scope resoloution operator, but that's just me - some people would argue that's it's quick and an effective way to use other namespaces and thus an efficient way of programming, my argument to that would be that it's not nesassaraly good practice just to use resources that aren't hardly being used or at all for efficiency's sake.

I don't think it's classed as bad coding techniques, more a prefference.
-System error
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Boost does also use nested namespaces extensively.

Also quoting from "The Zen of Python":
Namespaces are one honking great idea -- let's do more of those!

And we all know Python does everything perfect ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Cool! hehe..

Thanks guys.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

I use namespaces because if for some reason in the future Irrlicht chanes core to main or something, I won't have to edit all my code.
Post Reply