Skip to content
Enes Hecan edited this page Dec 30, 2017 · 4 revisions

Welcome to the CleanCode wiki!

Requirements

For only C++ language now.

Basic

Readability

  • Uninitialized variables
  • Unused variables
  • Suggest indentation if doesn't exist
  • Suggest that braces should exist in a line on their own to indicate them as a sign of scope
  • Alignment of similar data types
  • Analyze length of methods
  • Check namings
  • const keyword usage
  • Encourage less commenting by suggesting using explanatory names
  • Suggest auto keyword where data type is very long
  • Suggest typedef for often used data types consist of multiple types

Prevent Bugs

  • Avoid unsigned data types
  • Prefer sizeof(varname) to sizeof(type)
  • Destroy objects in orderly in the destructor
  • Avoid using namespace directive
  • Define a guard or pragma at the beginning of every header

Performance

  • make_shared instead of reset where it is usable
  • nullptr instead of NULL
  • Suggest const type X = val instead of #define X val

Advanced

  • Convention consistency
Clone this wiki locally