Download Elements of C++ Style by Misfeldt T., Gray A., Metz E. PDF

By Misfeldt T., Gray A., Metz E.

Except they've got set criteria previously, groups of programmers will locate it tough to learn and use every one others' code in the first couple of minutes of the initiation of a undertaking. in spite of the fact that, making a commonplace can take extra time than the undertaking itself. for you to decrease frustration and inefficiency, those authors, all of whom are high-end clients and builders, provide normal ideas for C++ code, together with ideas and conventions for naming, documentation, programming, and packaging, and a quick thesaurus.

Show description

Read Online or Download Elements of C++ Style PDF

Similar programming: programming languages books

PHP MySQL avec Flash 8

Réaliser des websites dynamiques en Flash avec ActionScript, MySQL et personal home page (versions five ou 4). remark afficher sur web des données en temps réel, tels les résultats d'une élection ou le ranking d'un fit de tennis ? Grâce à Flash eight, personal home page et MySQL, qui permettent de concevoir des interfaces internet graphiques et conviviales, couplées à des bases de données.

The Web Designers Guide to iOS Apps: Create iPhone, iPod touch, and iPad apps with Web Standards (HTML5, CSS3, and j#097;vascript)

When you are a dressmaker who understands HTML, CSS, and javascript, you could simply easy methods to make local iPhone, iPod contact, and iPad apps—and distribute them world wide through the App shop. whilst mixed with an Objective-C framework, internet criteria can be utilized to layout and elegance content material for iOS, utilizing local controls and behaviors for an real Apple person event.

Additional info for Elements of C++ Style

Example text

Use this style to eliminate confusion in names where uppercase letters act as word separators. This is especially important if one abbreviation immediately follows another: XMLString > XmlString loadXMLDocument() > loadXmlDocument() This rule does not apply to abbreviations that appear within the name of a preprocessor constant because these names only contain capital letters (see Rule 11): #define XML_DOCUMENT = "text/XML"; The rule does not apply to abbreviations that appear at the beginning of a function, variable, or parameter name because these names should always start with a lowercase letter: Document xmlDocument xmlDocument; TEAM LinG 28 THE ELEMENTS OF C++ STYLE 31.

Use Meaningful Names Use names that are, and will remain, meaningful to those who will eventually read your code. Use meaningful words to create names. Avoid using a single character or generic names that do little to define the purpose of the entities they name. The purpose for the variable “a” and the constant “65” in the following code is unclear: if (a < 65) {// What property does ‘a’ describe? y = 65 - a;// What is being calculated here? } else { y = 0; } The code is much easier to understand when meaningful names are used: if (age < RetirementAge) { yearsToRetirement = RetirementAge - age; } else { yearsToRetirement = 0; } The only exception to this rule concerns temporary variables whose context provides sufficient information to determine their purpose, such as a variable used as a counter or index within a loop: for (size_t i = 0; i < numberOfStudents; ++i) { enrollStudent(i); } TEAM LinG 26 THE ELEMENTS OF C++ STYLE 26.

Use a Single Consistent Format and Organization for All Documentation Comments Each software element that appears in an API possesses characteristics that may have significance for users. Standardize upon a set of characteristics that must be documented for each type of software element. Specify the order in which the descriptions of these characteristics should appear within the documentation block. Indicate which descriptions are required and which are optional. Specify the handling of inapplicable characteristics.

Download PDF sample

Rated 4.90 of 5 – based on 9 votes