Difference between revisions of "Coding Style"

From Mineserver Wiki
Jump to navigation Jump to search
** '''Static (class) variables''' should start with just an underscore, e.g. '''_instance''', '''_users''' etc.
** '''Static (class) variables''' should start with just an underscore, e.g. '''_instance''', '''_users''' etc.
* '''Namespaces''': We probably should use them.
* '''Namespaces''': We probably should use them.
−
* '''Codeblocks''': (Use braces always for clarity and to prevent bugs while editing code)
+
* '''Codeblocks''': Use braces always for clarity and to prevent bugs while editing code
−
if(true)
+
if (true)
    {
    {
      foo = bar;
      foo = bar;
    }
    }
−
if(true)
+
if (true)
    {
    {
      foo = bar;
      foo = bar;
 
    Foo* bar = new Foo();
    Foo* bar = new Foo();
    fooBar(param1, param2, param3);
    fooBar(param1, param2, param3);
−
for(int i = 0; i < 1; i++)
+
for (int i = 0; i < 1; i++)
    {
    {
−
     
+
      ...
    }
    }