src/ folder structure in C++?

前端 未结 6 1154
离开以前
离开以前 2021-02-02 00:01

i\'m coming into C++ from Java/AS3-land, and i\'m used to the package-cum-folder structure for my classes. and i like it.

i understand the very basics of namespaces in

6条回答
  •  甜味超标
    2021-02-02 00:53

    I've always liked the namespace for each folder. Mostly because when I have to maintain somebody else's code, the namespace helps me find where the class was originally defined.

    Well named header files can also help with this though. I also wouldn't suggest going more than 2-3 namespaces, as then it just becomes obnoxious. You'll find yourself using "using namespace blah;" a lot which I always find to be a red flag for C++ code. And you can't use "using namespace" inside a header file without some severe problems occurring.

    It's all completely optional though in C++.

提交回复
热议问题