Changes between Initial Version and Version 1 of CodingGuidelines


Ignore:
Timestamp:
Feb 24, 2010, 2:48:01 PM (15 years ago)
Author:
FrederikHeber
Comment:

first version

Legend:

Unmodified
Added
Removed
Modified
  • CodingGuidelines

    v1 v1  
     1== How ESPACK code should look like ==
     2
     3Below you find a brief but hopefully complete list on how the code of espack should look like:
     4
     5   * identate by two spaces
     6   * Code Style from Eclipse, see [attachment:ESPACK_codesyle.xml]:
     7{{{
     8/*
     9 * A sample source file for the code formatter preview
     10 */
     11#include <math.h>
     12
     13class Point
     14{
     15public:
     16  Point(double xc, double yc) :
     17    x(xc), y(yc)
     18  {
     19  }
     20  double distance(const Point& other) const;
     21
     22  double x;
     23  double y;
     24};
     25
     26double Point::distance(const Point& other) const
     27{
     28  double dx = x - other.x;
     29  double dy = y - other.y;
     30  return sqrt(dx * dx + dy * dy);
     31}
     32}}}