文章

关于谷歌c++编程规范

良好的命名真的很重要

谷歌命名规范

一个图片大纲

google.png

附上我看见过的最全面的博客

谷歌c++规范

为啥不用匈牙利命名法

早期坚定拥护匈牙利命名法的Microsoft在 .NET Framework后,已经不再建议程序员使用匈牙利命名法了。

微软新的变量名称建议General Naming Conventions原文如下:

Donot use Hungarian notation. Hungarian notation isthe practice of including a prefix in identifiers to encode some metadata aboutthe parameter, such as the data type of the identifier.

附上一句很经典的原话:

“避免使用匈牙利记法,它会让你的承诺落空。赘物并非信息,而是混淆耳目的伪信息。”

谷歌规范检查工具

Cpplint是一个python脚本,Google使用它作为自己的C代码规范检查工具。如果你所在的公司也使用Google C代码规范,那么你有必要了解下Cpplint。

下面说一下Cpplint在windows下的简单使用:

  1. 此处下载cpplint.py源码,并将其存放到D:\soft\Cpplint\cpplint.py中;

  2. 安装python2,并将D:\ProgramFiles\Python27 添加到系统环境变量Path中;

vs用户可以参考这个博文来进行配置。


License:  CC BY 4.0