Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
diana:diana_codestyle [2008-12-03 13:49:24] lisbethb created |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Code style ====== | ||
| - | * Code style for Eclipse: | ||
| - | * Use single blank lines | ||
| - | * Use doxygen (java or c++) | ||
| - | * Always use downcase in namespace | ||
| - | * Space after semicolon in for-loops etc. | ||
| - | * Space before and after assignment operators | ||
| - | |||
| - | ... and follow the example below ... | ||
| - | |||
| - | < | ||
| - | |||
| - | namespace metno { | ||
| - | |||
| - | const int DEFAULT_NUMBER = 1; | ||
| - | |||
| - | /** | ||
| - | * A sample source file for the code formatter preview | ||
| - | */ | ||
| - | class Point { | ||
| - | public: | ||
| - | /** | ||
| - | * @param xc bla bla | ||
| - | */ | ||
| - | Point(double xc, double yc) : x(xc), y(yc) { } | ||
| - | |||
| - | Point(double yc) : y(yc) | ||
| - | { | ||
| - | if (true) { | ||
| - | | ||
| - | } else if (false) { | ||
| - | | ||
| - | } | ||
| - | for (int i = 0; i < yc; ++i) { ///< space etter ; | ||
| - | int j = 0; | ||
| - | } | ||
| - | |||
| - | } | ||
| - | | ||
| - | /** | ||
| - | * Description of distance | ||
| - | */ | ||
| - | double distance(const Point& other) const; | ||
| - | int minParam; | ||
| - | double x; ///< a doxygen comment on dx | ||
| - | double y; | ||
| - | char *hello; | ||
| - | Point& p; | ||
| - | |||
| - | /// Enum description | ||
| - | enum MyEnum {ONE, TWO, THREE}; | ||
| - | |||
| - | }; | ||
| - | |||
| - | double Point:: | ||
| - | double dx = x - other.x; | ||
| - | LOG4CXX_DEBUG(logger,"" | ||
| - | double dy = y - other.y; // comment | ||
| - | return sqrt(dx * dx + dy * dy); | ||
| - | } | ||
| - | |||
| - | } // end namespace metno | ||
| - | |||
| - | </ | ||