Difference between revisions of "Coding Style"

From Mineserver Wiki
Jump to navigation Jump to search
     Baz* Foo::foo(Bar* bar);
     Baz* Foo::foo(Bar* bar);
** Note: Documentation should go in to the header file.
** Note: Documentation should go in to the header file.
−
* '''Class definitions''':
+
* '''Class definitions''': Put public methods at the top of the definition. They're usually the most interesting part from a user's point of view. Private stuff at the bottom.
 +
    class Foo {
 +
      public:
 +
      Foo();
 +
      ~Foo();
 +
    
 +
      /**
 +
       * The foo() method. Does some fooish stuff, yo!
 +
       * @param bar Bar instance to be used in foo().
 +
       * @return An instance of Baz that does something fantastic!
 +
       */
 +
      Baz* foo(Bar* bar);
 +
 +
      private:
 +
      /* private instance vars etc go here.*/
 +
    }