FRIDA C++ coding conventions
As all other implementation notes, this is subject to change during the real implementation work.
The code layout basically follows Kernigham & Ritchie style with 4 blanks indentation.
If in doubt, the command
indent -kr <file>
can be used on new code. However, this automatic layout tool shall not be used on existing code. It's layout is not free of inconsistencies, especially regarding blanks before and inside parentheses and blanks before/after * and & operators in function argument lists - but it's much better than any automatic solution.
//! <short description>, above a class|typedef|.. in the declaration (.h) file /** <long description>, follows short description if one line is not enough ... */ <variable> ///!< inline explanation of a variable
class, namespace: upper case, camel case if appropriate
singleton class instance: the<Class>, e.g. theWorkspace
class member functions: lowercase. This is a change from Frida-pre-2
vectors and other non-elementary data: lowercase, or camel case starting with lowercase
pointer class: <Class>Ptr
pointer and smart pointer: no explicit p.., ..prt, or whatever. Look at the definition which is rarely far away.
Should be more explicit than in earlier versions, as far as the generic frame is concerned.
In contrast, inner loops of numeric routines continue to be as concise as possible.
Consistent use of letters is primordial in cryptic programming. Beware however pedantic application of Hungarian convention.
or curves) in WorkFile / DataFile / CurvFile
do_something( const int size_in ): “const” has no effect upon calling program (size_in won't be modified anyway, because it is passed by value to do_something). Therefore: write “const” only in the implementation, not in the declaration.