C++ Programming Style Guidelines.pdf

C++ Programming Style Guidelines.pdf - C C Programming...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
C++ Programming Style Guidelines Version 4.9, January 2011 Geotechnical Software Services Copyright © 1996 ‐ 2011 This document is available at Table of Content 1 Introduction 1.1 Layout of the Recommendations 1.2 Recommendations Importance 2 General Recommendations 3 Naming Conventions 3.1 General 3.2 Specific 4 Files 4.1 Source Files 4.2 Include Files and Include Statements 5 Statements 5.1 Types 5.2 Variables 5.3 Loops 5.4 Conditionals 5.5 Miscellaneous 6 Layout and Comments 6.1 Layout 6.2 White space 6.3 Comments 7 References 1 Introduction This document lists C++ coding recommendations common in the C++ development community. The recommendations are based on established standards collected from a number of sources, individual experience, local Summer @ UCLA Extension Take HR Courses In­Class or Online. Highly Experienced HR Instructors.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
requirements/needs, as well as suggestions given in [1] [4] . There are several reasons for introducing a new guideline rather than just referring to the ones above. The main reason is that these guides are far too general in their scope and that more specific rules (especially naming rules) need to be established. Also, the present guide has an annotated form that makes it far easier to use during project code reviews than most other existing guidelines. In addition, programming recommendations generally tend to mix style issues with language technical issues in a somewhat confusing manner. The present document does not contain any C++ technical recommendations at all, but focuses mainly on programming style. For guidelines on C++ programming style refer to the C++ Programming Practice Guidelines . While a given development environment (IDE) can improve the readability of code by access visibility, color coding, automatic formatting and so on, the programmer should never rely on such features. Source code should always be considered larger than the IDE it is developed within and should be written in a way that maximise its readability independent of any IDE. 1.1 Layout of the Recommendations. The recommendations are grouped by topic and each recommendation is numbered to make it easier to refer to during reviews. Layout of the recommendations is as follows: n. Guideline short description Example if applicable Motivation, background and additional information. The motivation section is important. Coding standards and guidelines tend to start "religious wars", and it is important to state the background for the recommendation. 1.2 Recommendation Importance In the guideline sections the terms must , should and can have special meaning. A must requirement must be followed, a should is a strong recommendation, and a can is a general guideline. 2 General Recommendations 1. Any violation to the guide is allowed if it enhances readability.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern