Every programmer will have a style of programming, the way they write the programs. But, when you work as a team, it would be very useful if you and your team follow one 'programming style' for code readability and consistency.
Here are some of the standard practices:
- Adhere to the existing style
- If a source file already has a style, please adhere to the existing style
- Use 4 space indented code blocks, making it 4 spaces make room of more code within 80 columns.
- Use expanded tabs. By this way your code won't look different in different environments
- Follow only one brace-opening style
- Use White-spaces between keywords, variables, operators for better readability
- Use a Standard Naming Convention
- Add prefix for macros within a module to avoid conflict with global
- "UpperCamelCase" for classes, structs, enums, constants and typedefs (use nouns)
- "lowerCamelCase" for functions, variables, parameters even for abbreviations (use verb for function names)
- Use 'get', 'set' - function prefixes. 'is' prefix for functions which returns Boolean(true or flase) value
Reference: Read "The Elements of C++ Programming Style."