C++ Code Style

In order to keep an easy-to-read, consistent and aesthetically pleasing look to the Trimble code, the following coding style guide is advised.

Reference Code Standard

  • Google C++ Style Guide

    • Modern
    • Provides good rationale for decisions, including even counter-arguments
    • Exceptions to the code style allowed to maintain local consistency in existing code

Exceptions to the Standard

None. Exceptions that would benefit a specific project should be documented along with a rationale for the exception.

Implementing the Standard

Tools/ProceduresTypeIn Use ByNotes
cpplint.pyOpen SourceTeklaValidates Google code style. It can be modified to account for any exceptions we add to the original standard.
SonarQubeOpen Source and CommercialTeklaContinuous Inspection, centralization of quality, DevOps integration, detection of tricky issues.
clang-formatFreeTeklaFormats source code according to style guide.
Peer reviewsSketchUpValidates of code style, code quality.

Businesses Using Language

BusinessCodebaseNotes
SketchUp
TeklaStructuresSonarQube as a style enforcer
  • Boost Library Req and Guidelines

    • Good documentation of what goes into setting up a Boost library project. Contains links to other documents and references to books.