wiki:CodingGuidelines

Version 1 (modified by FrederikHeber, 15 years ago) ( diff )

first version

How ESPACK code should look like

Below you find a brief but hopefully complete list on how the code of espack should look like:

  • identate by two spaces
  • Code Style from Eclipse, see ESPACK_codesyle.xml:
    /*
     * A sample source file for the code formatter preview
     */
    #include <math.h>
    
    class Point
    {
    public:
      Point(double xc, double yc) :
        x(xc), y(yc)
      {
      }
      double distance(const Point& other) const;
    
      double x;
      double y;
    };
    
    double Point::distance(const Point& other) const
    {
      double dx = x - other.x;
      double dy = y - other.y;
      return sqrt(dx * dx + dy * dy);
    }
    

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.