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 .
Namespace inside a namespace? Good/Bad Practice? what u say?
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Irrlicht
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
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
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.
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.
-
- Posts: 98
- Joined: Fri Oct 03, 2008 1:25 pm
- Location: UK
- Contact:
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.
I don't think it's classed as bad coding techniques, more a prefference.
-System error
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 ;-)
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm