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 Standard Library.
下划线用于分隔名称的各个部分,是C和C 的原始样式,并在C 标准库中使用。
Note(注意)
This rule is a default to use only if you have a choice. Often, you don't have a choice and must follow an established style for consistency. The need for consistency beats personal taste.
此规则是默认值,仅在您可以选择时使用。通常,您别无选择,必须遵循既定风格来保持一致性。对一致性的需求高于个人品味。
This is a recommendation for when you have no constraints or better ideas. This rule was added after many requests for guidance.
当您没有约束或更好的想法时,这是一个建议。在许多准则的要求之后添加了此规则。
Example(示例)
Stroustrup: ISO Standard, but with upper case used for your own types and concepts:
Stroustrup:ISO标准,但大写字母用于您自己的类型和概念:
int
vector
My_map
Enforcement(实施建议)
Impossible.
不可能。
原文链接
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#nl10-prefer-underscore_style-names