Open Nav

C++背景,头文件,作用域

以下是资料介绍,如需要完整的请充值下载.
1.无需注册登录,支付后按照提示操作即可获取该资料.
2.资料以网页介绍的为准,下载后不会有水印.仅供学习参考之用.
   帮助中心
资料介绍:

中文翻译
C++背景,头文件,作用域(中文3400字,英文2500字)
•    背景
Google的开源项目大多使用C++开发。每一个C++程序员也都知道,C++具有很多强大的语言特性,但这种强大不可避免的导致它的复杂,这种复杂会使得代码更易于出现bug、难于阅读和维护。
本指南的目的是通过详细阐述在C++编码时要怎样写、不要怎样写来规避其复杂性。这些规则可在允许代码有效使用C++语言特性的同时使其易于管理。
风格,也被视为可读性,主要指称管理C++代码的习惯。使用术语风格有点用词不当,因为这些习惯远不止源代码文件格式这么简单。
使代码易于管理的方法之一是增强代码一致性,让别人可以读懂你的代码是很重要的,保持统一编程风格意味着可以轻松根据“模式匹配”规则推断各种符号的含义。创建通用的、必需的习惯用语和模式可以使代码更加容易理解,在某些情况下改变一些编程风格可能会是好的选择,但我们还是应该遵循一致性原则,尽量不这样去做。
本指南的另一个观点是C++特性的臃肿。C++是一门包含大量高级特性的巨型语言,某些情况下,我们会限制甚至禁止使用某些特性使代码简化,避免可能导致的各种问题,指南中列举了这类特性,并解释说为什么这些特性是被限制使用的。 [来源:http://www.doc163.com]

外文原文
Background
C++ is the main development language used by many of Google's open-source projects. As every C++ programmer knows, the language has many powerful features, but this power brings with it complexity, which in turn can make code more bug-prone and harder to read and maintain.
The goal of this guide is to manage this complexity by describing in detail the dos and don'ts of writing C++ code. These rules exist to keep the code base manageable while still allowing coders to use C++ language features productively.
Style, also known as readability, is what we call the conventions that govern our C++ code. The term Style is a bit of a misnomer, since these conventions cover far more than just source file formatting.
One way in which we keep the code base manageable is by enforcing consistency. It is very important that any programmer be able to look at another's code and quickly understand it. Maintaining a uniform style and following conventions means that we can more easily use "pattern-matching" to infer what various symbols are and what invariants are true about them. Creating common, required idioms and patterns makes code much easier to understand. In some cases there might be good arguments for changing certain style rules, but we nonetheless keep things as they are in order to preserve consistency. [来源:http://www.doc163.com]

  • 关于资料
    提供的资料属本站所有,真实可靠,确保下载的内容与网页资料介绍一致.
  • 如何下载
    提供下载链接或发送至您的邮箱,资料可重复发送,若未收到请联系客服.
  • 疑难帮助
    下载后提供一定的帮助,收到资料后若有疑难问题,可联系客服提供帮助.
  • 关于服务
    确保下载的资料和介绍一致,如核实与资料介绍不符,可申请售后.
  • 资料仅供参考和学习交流之用,请勿做其他非法用途,转载必究,如有侵犯您的权利或有损您的利益,请联系本站,经查实我们会立即进行修正! 版权所有,严禁转载
    doc163.com Copyright © 2012-2024 苏ICP备2021029856号-4