zoukankan      html  css  js  c++  java
  • google c++ style guide (1) Naming 鸟人翻译

    这里翻译Naming部分的内容,因为最近感觉自己程序中命名部分不太好,屡次修改,故而拜读一下google的经验,学习学习。

    Naming

    The most important consistency rules are those that govern naming. The style of a name immediately informs us what sort of thing the named entity is: a type, a variable, a function, a constant, a macro, etc., without requiring us to search for the declaration of that entity. The pattern-matching engine in our brains relies a great deal on these naming rules.

    Naming rules are pretty arbitrary, but we feel that consistency is more important than individual preferences in this area, so regardless of whether you find them sensible or not, the rules are the rules.”

         最重要的一致性规则就是对于命名的掌控,命名可以帮助我们轻松愉快的读懂代码,分清类型,变量,函数,常量,宏,等等等。。而不必去前后翻页寻找相关初始定义。总之,存于心,见于行。

         命名规则当然是非常随意的囖,但是,在这块过于讲求个性不利于他人读懂你的代码,所以,讲讲规矩总是好事,你遵守或者不理睬,它就在那里,不悲不喜。。(肚子饿了。。)


  • 相关阅读:
    使用接口测试活动的中奖概率(随机事件测试)
    关于测试用例冗余的一些思考
    正则表达式经典实例
    自动化测试断言Assent的使用
    equals与==区别
    Git的使用以及GitHub
    django的配置文件字符串是怎么导入的?
    支付宝支付相关开发
    Django的contenttypes
    推荐课程及用户登录
  • 原文地址:https://www.cnblogs.com/superniaoren/p/Goole_Cpp_Style_Translation.html
Copyright © 2011-2022 走看看