Difference between revisions of "Coding Conventions & Style"

From MNE-CPP Wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Template Class Headers and Source files:'''
+
'''The QtCreator Wizard:'''
  
Please see the TemplateClass header and source files in mne-cpp/tools/coding_conventions/Template_Class for an example how to structure your classes.
+
We strongly recommend to make use of the MNE-CPP QtCreator wizard to add new classe to any project (you can find the installation guide [[Setup the MNE-CPP QtCreator wizard|'''here''']]).
  
 
'''Naming Conventions:'''
 
'''Naming Conventions:'''
 +
 +
Please make use of the following coding conventions as soon as you plan to contribute to MNE-CPP.
 +
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 18: Line 21:
 
| Local variables || typeMeaningfulName
 
| Local variables || typeMeaningfulName
 
|}
 
|}
 +
 +
'''Command Line Output:'''
 +
 +
Please make use of qDebug() for debugging, qInfo() for user information and qWarning for user warning purposes. qFatal() should only be used to initiate a total application stop. Please note that Eigen structures can only be plotted via std::cout (you therefore need to add #include<iostream.h>).
  
 
'''Readability and Understandability:'''
 
'''Readability and Understandability:'''
 
* Avoid complex and condensed expressions
 
* Avoid complex and condensed expressions
* use meaningful variable names
+
* Use meaningful variable names
  
 
'''Using Doxygen:'''
 
'''Using Doxygen:'''
  
Please use DoxyGen as shown in the TemplateClass [https://raw.githubusercontent.com/mne-tools/mne-cpp/master/tools/coding_conventions/qtCreator_wizard/mne_templates/templateclass.h header] and [https://raw.githubusercontent.com/mne-tools/mne-cpp/master/tools/coding_conventions/qtCreator_wizard/mne_templates/templateclass.cpp source] files. Don't forget to change the documentation header in the header and source file. It should always include the file's and your name (E-Mail adress). Also add the current date and all other necessary descriptions. We strongly recommended to make use of the MNE-CPP QtCreator wizard (you can find the installation guide [[Setup the MNE-CPP QtCreator wizard|'''here''']]).
+
Please use the DoxyGen style to document your code.

Latest revision as of 17:25, 31 January 2018

The QtCreator Wizard:

We strongly recommend to make use of the MNE-CPP QtCreator wizard to add new classe to any project (you can find the installation guide here).

Naming Conventions:

Please make use of the following coding conventions as soon as you plan to contribute to MNE-CPP.

Object Rule
Namespace MYNAMESPACE
Classes MyClass
Member functions myFunction
Member variables m_typeMeaningfulName
Local variables typeMeaningfulName

Command Line Output:

Please make use of qDebug() for debugging, qInfo() for user information and qWarning for user warning purposes. qFatal() should only be used to initiate a total application stop. Please note that Eigen structures can only be plotted via std::cout (you therefore need to add #include<iostream.h>).

Readability and Understandability:

  • Avoid complex and condensed expressions
  • Use meaningful variable names

Using Doxygen:

Please use the DoxyGen style to document your code.