Adivce from the father of C++
2007-03-18 17:59
441 查看
Advice
[1] Use namespaces to express logical structure;
[2] Place every nonlocal name,except main(),in some namespcace;
[3] Design a namespace so that you can conveniently use it without accidentally gaining accessing to unrelated namespaces;
[4] Avoid very short names for namespaces;
[5] If necessary,use namespace aliases to abbreviate long namespaces;
[6] Avoid placing heavy notational burdens on users of your namespaces;
[7] Use the Namespace::member notation when defining namespace members;
[8] Use using namespace only for transition or within a local scope;
[9] Using exceptions to decouple the treatment of "errors" from the code dealing with the ordinary processing;
[10]Use user-defines rather than bulit-in types as exceptions;
[11]Don't use exceptions when local control structures are sufficient.
[1] Use namespaces to express logical structure;
[2] Place every nonlocal name,except main(),in some namespcace;
[3] Design a namespace so that you can conveniently use it without accidentally gaining accessing to unrelated namespaces;
[4] Avoid very short names for namespaces;
[5] If necessary,use namespace aliases to abbreviate long namespaces;
[6] Avoid placing heavy notational burdens on users of your namespaces;
[7] Use the Namespace::member notation when defining namespace members;
[8] Use using namespace only for transition or within a local scope;
[9] Using exceptions to decouple the treatment of "errors" from the code dealing with the ordinary processing;
[10]Use user-defines rather than bulit-in types as exceptions;
[11]Don't use exceptions when local control structures are sufficient.
相关文章推荐
- 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++ 写的计算器,只有源代码
- 20 issues of porting C++ code to the 64-bit platform
- How to change the background color of form using C++ - 如何用C++改变窗体的颜色
- C++ and The Perils of Double-Checked Locking: Part I
- POJ 3510 A Tale from the Dark Side of the Moon 可能会
- C&C++学习笔记1--The seven steps of programming
- Pointers, Arrays, and Structures(Chapter 5 of The C++ Programming Language)
- 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++实现)
- "The Design and Evolution of C++" 阅读笔记
- [Programming Visual C++]Chapter Five - The Lifetime of a GDI Selection