Google C++ Style Guide - Google C++ 风格指南

韩飞翮
2023-12-01

Google C++ Style Guide - Google C++ 风格指南

Every major open-source project has its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that project. It is much easier to understand a large codebase when all the code in it is in a consistent style.
每个较大的开源项目都有自己的风格指南:关于如何为该项目编写代码的一系列约定 (有时候会比较武断)。当所有代码均保持一致的风格,在理解大型代码库时更为轻松。

“Style” covers a lot of ground, from “use camelCase for variable names” to “never use global variables” to “never use exceptions.” This project (google/styleguide) links to the style guidelines we use for Google code. If you are modifying a project that originated at Google, you may be pointed to this page to see the style guides that apply to that project.
风格的含义涵盖范围广,从“变量使用驼峰格式 (camelCase)”到“决不使用全局变量”再到“决不使用异常”,等等诸如此类。英文版项目维护的是在 Google 使用的编程风格指南。如果你正在修改的项目源自 Google,你可能会被引导至英文版项目页面,以了解项目所使用的风格。

This project also contains cpplint, a tool to assist with style guide compliance, and google-c-style.el, an Emacs settings file for Google style.
英文版项目还包含 cpplint - 一个用来帮助适应风格准则的工具,以及 google-c-style.el,Google 风格的 Emacs 配置文件。
https://github.com/google/styleguide/tree/gh-pages/cpplint
https://raw.githubusercontent.com/google/styleguide/gh-pages/google-c-style.el

1. Google C++ Style Guide - Google C++ 风格指南

Google C++ Style Guide
https://google.github.io/styleguide/cppguide.html

Google C++ 风格指南
https://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/contents/

2. Google Style Guides

https://github.com/google/styleguide

3. Google 开源项目风格指南 (中文版)

https://zh-google-styleguide.readthedocs.io/en/latest/

4. Note

Google Style Guides
https://github.com/google/styleguide

Google 开源项目风格指南 - GitHub 托管地址
https://github.com/zh-google-styleguide/zh-google-styleguide

Google 开源项目风格指南 - 下载离线文档
https://github.com/zh-google-styleguide/zh-google-styleguide/releases

References

https://yongqiang.blog.csdn.net/

 类似资料: