The OPR Developers have agreed on a common set of rules for the Perl code implementation. These rules are designed to make the code as easily readable and understandable as possible for other developers and to ensure consistency over the whole system code.

Currently all the code is contained in the CVS package OprControlSys.

In Perl each class is contained in a different .pm [module] file. The filename is the same as the class name. The class names should be descriptive as much as possible, using descriptive suffixes like:

In the code itself, it preferable to put one command per line, with this style for the if/then/else construct:

if(...) {
...
} else {
...
}

Also the comments should be indented with the code they refer to, generously spread throughout the source code.

Standard headers will be available in the relevant package[s] so that all files provide a basic set of informations.

The following coding conventions will be enforced:

The methods should always be created with a comment block. This comment block should contain the following meta-tags: #SIG (the method signature) -> (the method return value)
#DES a description of what the method does...
#DES on as many lines as it's needed.

The use of meta-tags will make it possible to automatically generate the documentation for a class. This is analogous but simplified with respect to POD.


This page created by FST [safai@slac.stanford.edu] on 01/04/2002 at 7.15pm.