Advertisement

How to use namespaces in structuring a project

Started by December 11, 2016 02:20 AM
11 comments, last by jillion 7 years, 11 months ago
OK, so this is what I've decided to do. For personal projects, I shall never use namespaces and when I do have two classes having functions all with the same names, I'll either put that in a namespace or just use Python to glue different modules written in C++ together by using "import module_with_same_name as new _name_for_module"
Anything particularly wrong with what I've thought of for now?

Just try it for a while, afterwards you're in a position to evaluate your decision, and adjust if necessary.

Advertisement

OK, so this is what I've decided to do. For personal projects, I shall never use namespaces and when I do have two classes having functions all with the same names, I'll either put that in a namespace or just use Python to glue different modules written in C++ together by using "import module_with_same_name as new _name_for_module"
Anything particularly wrong with what I've thought of for now?

On a game engine I have never had a problem with a single wrapper namespace. For a simple project < 3000 lines of code you probably don't need a namespace. Also I recommend always wrapping your typedef enum's in their own namespace.

Bregma's answer above is also very interesting. ;P

Companies have their own way of doing things and adopt complex team-oriented practices that should not be used in individual projects.

This topic is closed to new replies.

Advertisement