Coding Style

From Mineserver Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "This is a suggestion for a coding style to be used consistently accross Mineserver's source code. * '''Indentation''': 2 spaces * '''Class names''': Camelcase, starting with upp...")
Line 4: Line 4:
* '''Class names''': Camelcase, starting with uppercase letter, e.g.: '''FurnaceManager'''
* '''Class names''': Camelcase, starting with uppercase letter, e.g.: '''FurnaceManager'''
* '''Variable and method names''': Camelcase, starting with lowercase letter, e.g.: '''updateWorld()''', '''userCommands'''.
* '''Variable and method names''': Camelcase, starting with lowercase letter, e.g.: '''updateWorld()''', '''userCommands'''.
-
** For loop variables short-names are 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.

Revision as of 22:19, 6 December 2010

This is a suggestion for a coding style to be used consistently accross Mineserver's source code.

  • Indentation: 2 spaces
  • Class names: Camelcase, starting with uppercase letter, e.g.: FurnaceManager
  • Variable and method names: Camelcase, starting with lowercase letter, e.g.: updateWorld(), userCommands.
    • 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.