Google C++ Style Guide

Benjy Weinberger, Craig Silverstein, Gregory Eitzmann, Mark Mentovai, Tashana Landray, “Google C++ Style Guide”, public translation into Russian from English More about this translation.

See also 6 similar translations

Translate into another language.

Participants

og11844 points
de-xar1486 points
Nemesis1061 points
And others...
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next next untranslated

Google C++ Style Guide

Google C++ Style Guide

Unapproved edits (Latest: nobodyzzz 2 years, 11 months ago) §

— Поставте теги «coding convention, coding style» Ruzzz

Background

Предпосылки

Unapproved edits (Latest: nobodyzzz 2 years, 11 months ago) §

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.

C++

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

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.

Цель этого

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

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.

Сти

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

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.

О

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

Another issue this guide addresses is that of C++ feature bloat. C++ is a huge language with many advanced features. In some cases we constrain, or even ban, use of certain features. We do this to keep code simple and to avoid the various common errors and problems that these features can cause. This guide lists these features and explains why their use is restricted.

Д

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

Open-source projects developed by Google conform to the requirements in this guide.

О

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

Note that this guide is not a C++ tutorial: we assume that the reader is familiar with the language.

О

History of edits (Latest: 4ever_young 7 months, 1 week ago) §

Header Files

Заголовочные файлы

History of edits (Latest: Reset 11 months, 2 weeks ago) §

In general, every .cc file should have an associated .h file. There are some common exceptions, such as unittests and small .cc files containing just a main() function.

О

History of edits (Latest: 4ever_young 7 months, 1 week ago) §
Pages: ← previous Ctrl next next untranslated