![]() |
|
||||||||||||||||||||||||
Home > Documentation > Standards Variable NamingVariables are named using a convention similar to the one described by Scott Meyers in Effective C++. Variables are written in camel case (i.e. variableName). Member variables are differentiated from local variables and function parameters by a trailing underscore (i.e. variableName_). Previously the code was written using Hungarian Notation. Hungarian Notation is a naming convention where the first few letters of a variable's name indicate the type of that variable. If you are working in a code segment that used this naming scheme, please take the time to rename some of the variables with the new standard. Some constants are defined in constants.h using the #define preprocessor directive. However, modifications of constants.h cause the entire project to recompile; now, we are trying to make constants static constant members of the classes that need them. Name constants in all uppercase with underscores such as: MAX_SPEED. File namesAll file and directory names should be lower case (preferably without underscores). Source files should end in .cpp and header files should end in .h. Directory StructureThe directory structure of the robocup source files is consistent
with the default settings of KDevelop v2.0. Functions Function names should start lowercase and then become
uppercase (camel case). The curly braces are on the line after
the function prototype. ClassesClass names should start uppercase and stay uppercase for every
additional world. Class members follow the camel case, trailing underscore notation. CommentingTry to keep comments to a minimum by coding as clearly as possible. Comment using the // style unless you are temporarily commenting
out a block of code during debugging. To indicate code segments
that need modification use: |
|||||||||||||||||||||||||
|
Have questions? Email David Evans |