Programming Naming Conventions

De Transport
(Redirigé depuis ProgrammingStyle)

I tend to favour the following rules, as can be seen in the Traffic Intelligence project

  • UpperCamelCase for classes
  • lowerCamelCase for methods
  • all upper cases for constants
  • explicit names, even if they have to be long, for variables
  • Python
    • 4 spaces for indentation (no tab!)
    • import the modules and use their content with the module prefix (instead of importing everything from the module, because of risks of name collisions; only exception is for limited scope in functions)
  • C++
    • shared pointers in C++
    • const and references for function arguments wherever possible in C++

Other resources