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
[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
相关文章推荐
- Adivce from the father of C++
- Adivce from the father of C++II
- Adivce from the father of C++III
- Adivce from the father of C++
- recompiled header file is from a previous version of the compiler, or the precompiled header is C++
- C++: 为什么我们一般都要将函数的声明和定义分开?(separate the declaration of function from its definition)
- How do you copy the contents of an array to a std::vector in C++ without looping? (From stack over flow)
- 改写the father of c++ 写的计算器,只有源代码
- C++ and The Perils of Double-Checked Locking: Part I
- Pointers, Arrays, and Structures(Chapter 5 of The C++ Programming Language)
- [Programming Visual C++]Chapter Five - The Lifetime of a GDI Selection
- Share a peice of movie script from Rocky Ⅵ which I love the most.
- Namespaces and Exceptions(Chapter 8 of The C++ Programming Language)
- 1200057 - When creating or refreshing a Crystal Report from a BW query, the list of available SAP sy
- The database page size of 4096 bytes obtained from ASE is different from the database page size of 2
- 【LeetCode】19 Remove Nth Node From End of List (c++实现)
- 20 issues of porting C++ code to the 64-bit platform
- "The Design and Evolution of C++" 阅读笔记
- POJ 3510 A Tale from the Dark Side of the Moon 可能会
- Elements of Programming Style -- The C++ Style Guide