Project

General

Profile

Actions

CodingRules » History » Revision 4

« Previous | Revision 4/7 (diff) | Next »
Jules Waldhart, 2016-05-30 16:24
more about enums


Coding Rules

Table of Contents

An unordered list of stuff we would like devs to follow

Naming

Classes, attributes, variables

  • ClassesAreCamelCase with first letter capital, also are all types (typedef, enum, struct,...)
  • methodsAreCamelCase with first letter lowercase
  • _attributeStartWithUnderscore and is camelcase
  • localVariable or local_variable, first letter lowercase
  • avoid calling a=function(1.0,6,false,true), declare local variables with descriptive name for the parameters: a=function(step_size,iteration_nb,enable_XYZ,multi_thread)

Enums

Put enums in an existing namespace or class, and/or create a struct and put it inside. That struct can also contain methods to convert to/from string and other types.

struct RobotType{
   enum Value {Robot, Human, Object};
   std::string toString(Value v);
   ...
}

Unimplemented stuff

  • not implemented functions: put an assert(false); in it, it will abort in debug mode, and do nothing in release. (instead of a print or whatever, which is totally unclear)
  • but mainly, avoid to commit unimplemented functions.

Updated by Jules Waldhart over 8 years ago · 7 revisions