Show Menu
Cheatography

Coding Style Guide Cheat Sheet (DRAFT) by

desc

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Descri­ption

Legend of used icons
mandatory rule
recomm­ended rule

File Names

shall equal class name if associated with class (same case and spelling)
Suffix .h for headers and .cpp for implem­ent­ation files

Directory Structure

3
test
e
r

Header Files

 

Include Statements

 

Braces

 

Indend­ation

 
 

Naming conven­tions

names shall only contain letters, digits and unders­­­core (No underscore at beginning, no sequence of unders­cores)
use CamelCase (the first letter of each word capita­lized)
Types
shall start with a capital letter
should be nouns
Variables
Private and protected member variables shall be prefixed with m
should not contain abbrev­iations of their type (no Hungarian notation)
Functions
should be verbs
Name Spaces
Names of name spaces shall only contain letters and digits
Examples:
mMyMem­ber­Var­iable; Import­ant­Number; Var_Wi­th_­Und­erScore

Invalid:
_Super­Sec­retVar; Sequen­ce_­_Of­___­Und­erS­cores 

Name Space Names

shall only contain letters and digits

Prepro­cessor Defines