From: wolf Date: Tue, 10 Aug 1999 15:16:14 +0000 (+0000) Subject: Move this file over from the deal.II directory. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6f59aa0e6bf159b26b79b8999110b95ca041bc1;p=dealii-svn.git Move this file over from the deal.II directory. git-svn-id: https://svn.dealii.org/trunk@1663 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/common/CodingConventions b/deal.II/common/CodingConventions new file mode 100644 index 0000000000..d3d5a9247b --- /dev/null +++ b/deal.II/common/CodingConventions @@ -0,0 +1,72 @@ +Here are some conventions for source code of the deal.II library: +================================================================= + +1./ Functions which return the number of something (number of cells, + degrees of freedom, etc) should start with n_* + +2./ Function which set a bit or flag should start with set_*; + functions which clear bits of flags should be named clear_* + +3./ After each function, at least three empty lines are expected to + enable better readability. One empty line occurs in functions to + group blocks of code, two empty lines are not enough to distinguish + visibly enough. + +4./ Whenever an integer variable can only assume nonnegative values, + it has to be marked as unsigned. + +5./ Whenever an argument will not be changed, it should be marked + const, even if it passed by value. This makes programs more readable + and lets the compiler issue warnings if such a parameter variable is + changed, which is often either involuntarily or poor style. + +6./ Whenever a function does not change any of the member variable of + the embedding class/object, it should be marked as const. + +7./ Function and variable names may not consist of only one or two + letters, unless the variable is a pure counting index. + +8./ Use the geometry information in GeometryInfo to get the + number of faces per cell, the number of children per cell, the + child indices of the child cells adjacent to face 3, etc, rather + than writing them into the directly as 2*dim, (1<