File: coding-style.txt

package info (click to toggle)
finalcut 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,832 kB
  • sloc: cpp: 90,264; makefile: 546; sh: 412
file content (47 lines) | stat: -rw-r--r-- 1,240 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
============
Coding style
============

Formatting
----------
* A new line should begin after 72 (max. 80) characters
* Use 2 spaces indent. Do not use tabs!
* Leave a space after the keywords if, switch, while, do, for, and return
* Conditions are placed in parentheses with spaces -> if ( a > 5 )
* Use one blank line before and after a for, if, switch, 
  while, do..while code block
* In parameter lists, leave a space after each comma
* Starting curly brace "{" in a new line

Naming
------
* class name: UpperCamelCase
* Function: lowerCamelCase
* Callback function: cb_lowerCamelCase (beginning with "cb_" as prefix)
* Variable: lower_case_underscored

Class declaration order
-----------------------
The declaration section order is:

  * public:
  * protected:
  * private:

Each declaration section should be in the following order:

  * Using-declarations (using std::string;)
  * Typedefs and Enumerations
  * Constants (static const data members)
  * Constructors
  * Destructor
  * Overloaded operators (=, +, -, +=. ...)
  * Accessors (getXY)
  * Mutators  (setXY)
  * Inquiries (isXY)
  * Methods, including static methods
  * Event handler methods
  * Callback methods
  * Data Members (except static const data members)