您的位置:首页 > 编程语言 > C语言/C++

Adivce from the father of C++

2007-03-19 21:57 495 查看
[1] Use header files to represent interfaces and to emphasize logical structure;
[2] #include a header in the source file that implements its function;
[3] Don't define global entities with the same name and similar-but-defferent meanings in different translation units;
[4] Use #include only at global scope and in namespaces;
[5] Avoid non-inline function definitions in headers;
[6] #include only complete declarations;
[7] Use include guards;
[8] #include C headers in namespaces to avoid global names;
[9] Make headers self-contained;
[10]Distinguish between user's interfaces and implemention's interfaces;
[11]Distinguish between average user's interfaces and expert user's interfaces;
[12] Avoid nonlocal objects that require run-time initialization in code intended for use as part of non-C++ programs
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++ 职场 休闲