加载中
C++核心准则​NL.21:每个声明(仅)声明一个名称

NL.21: Declare one name (only) per declaration NL.21:每个声明(仅)声明一个名称 Reason(原因) Readability. Minimizing confusion with the declarator syntax. 可读性。尽量减少与声...

C++核心准则​NL.25:不要将void用作参数类型

NL.25: Don't use void as an argument type NL.25:不要将void用作参数类型 Reason It's verbose and only needed where C compatibility matters. 它很冗长,只有在C兼容性很重要的情况下才...

C++核心准则​NL.15:谨慎使用空格

NL.15: Use spaces sparingly NL.15:谨慎使用空格 Reason(原因) Too much space makes the text larger and distracts. 太多的空格会使文本变长并分散注意力。 Example, bad(反面示例) ...

C++核心准则​NL.17:使用K&R风格派生的布局

NL.17: Use K&R-derived layout NL.17:使用K&R风格派生的布局 Reason(原因) This is the original C and C++ layout. It preserves vertical space well. It distinguishes different la...

C++核心准则​NL.18:使用C ++风格的声明符布局

NL.18: Use C++-style declarator layout NL.18:使用C ++风格的声明符布局 Reason(原因) The C-style layout emphasizes use in expressions and grammar, whereas the C++-style emphas...

C++核心准则​NL.19:避免容易被误读的名称

NL.19: Avoid names that are easily misread NL.19:避免容易被误读的名称 Reason(原因) Readability. Not everyone has screens and printers that make it easy to distinguish all ch...

C++核心准则​NL.20:不要在同一行上放置两个语句

NL.20: Don't place two statements on the same line NL.20:不要在同一行上放置两个语句 Reason(原因) Readability. It is really easy to overlook a statement when there is more on...

C++核心准则​NL.16:使用常规的类成员声明顺序

NL.16: Use a conventional class member declaration order NL.16:使用常规的类成员声明顺序 Reason(原因) A conventional order of members improves readability. 常规的成员顺序可以提...

C++核心准则​NL.10:首选下划线风格名称

NL.10: Prefer underscore_style names NL.10:首选下划线风格名称 Reason(原因) The use of underscores to separate parts of a name is the original C and C++ style and used in the...

C++核心准则​NL.11:使字面值可读

NL.11: Make literals readable NL.11:使字面值可读 Reason(原因) Readability. 可读性。 Example(示例) Use digit separators to avoid long strings of digits 使用数字分隔符避免数字...

C++核心准则​NL.4:保持一致的缩进样式

NL.4: Maintain a consistent indentation style NL.4:保持一致的缩进样式 Reason(原因) Readability. Avoidance of "silly mistakes." 可读性。避免“愚蠢的错误”。 Example, bad(反面...

C++核心准则​NL.5:避免在名称中包含类型信息

NL.5: Avoid encoding type information in names NL.5:避免在名称中包含类型信息 Rationale(基本原理) If names reflect types rather than functionality, it becomes hard to change ...

C++核心准则​NL.7:使名称的长度与作用域的大小大致成比例

NL.7: Make the length of a name roughly proportional to the length of its scope NL.7:使名称的长度与作用域的大小大致成比例 Rationale: The larger the scope the greater the chance...

C++核心准则​NL.8:使用一致的命名方式

NL.8: Use a consistent naming style NL.8:使用一致的命名方式 Rationale: Consistence in naming and naming style increases readability. 基本原理:命名和命名样式的一致性可以提高可读...

C++核心准则​NL.9:全字母大写仅用于宏名称

NL.9: Use ALL_CAPS for macro names only NL.9:全字母大写仅用于宏名称 Reason(原因) To avoid confusing macros with names that obey scope and type rules. 为了避免将宏与遵循范围和...

C++核心准则​:注释风格

NL.1: Don't say in comments what can be clearly stated in code NL.1:请不要在注释中说明代码可以清楚表达的内容 Reason(原因) Compilers do not read comments. Comments are less pr...

C++核心准则​GSL.ptr:智能指针相关概念

GSL.ptr: Smart pointer concepts GSL.ptr:智能指针相关概念 Pointer // A type with *, ->, ==, and default construction (default construction is assumed to set the singular "null"...

C++核心准则​NL:命名和布局规则

NL: Naming and layout rules NL:命名和布局规则 Consistent naming and layout are helpful. If for no other reason because it minimizes "my style is better than your style" argumen...

C++核心准则​GSL.concept:概念

GSL.concept: Concepts GSL.concept:概念 These concepts (type predicates) are borrowed from Andrew Sutton's Origin library, the Range proposal, and the ISO WG21 Palo Alto TR. Th...

C++核心准则​GSL.assert:断言

GSL.assert: Assertions GSL.assert:断言 Expects // precondition assertion. Currently placed in function bodies. Later, should be moved to declarations. // Expects(p) terminates...

没有更多内容

加载失败,请刷新页面

返回顶部
顶部