Difference between revisions of "Coding Style"

From Mineserver Wiki
Jump to navigation Jump to search
m
* '''Indentation''': 2 spaces
* '''Indentation''': 2 spaces
−
* '''Class names''': Camelcase, starting with uppercase letter, e.g.: '''FurnaceManager'''
+
* '''Class names''': PascalCase (e.g.: '''FurnaceManager''').
−
* '''Variable and method names''': Camelcase, starting with lowercase letter, e.g.: '''updateWorld()''', '''userCommands'''.
+
* '''Variable and method names''': camelCase, (e.g.: '''updateWorld''', '''userCommands''').
** '''Pointer variables''': Use '''Foo* bar''' instead of '''Foo *bar'''
** '''Pointer variables''': Use '''Foo* bar''' instead of '''Foo *bar'''
** Using short names for loop variables is ok, e.g. '''i''', '''j'''. Otherwise use descriptive names and don't use abbreviations all over the place, to make the code more readable.
** Using short names for loop variables is ok, e.g. '''i''', '''j'''. Otherwise use descriptive names and don't use abbreviations all over the place, to make the code more readable.