File: style_guide.md

package info (click to toggle)
spfft 1.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,680 kB
  • sloc: cpp: 11,562; f90: 665; ansic: 437; python: 41; makefile: 20
file content (49 lines) | stat: -rw-r--r-- 1,117 bytes parent folder | download | duplicates (4)
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
48
49
# Style Guide for SpFFT
## Formatting
The formatting style is based on the google style guide with the following exceptions:
- Column size is limited to 100 instead of 80
- Access modifiers such as public and private are offset by -2

Clang-Format is used to format all files.

## Naming
The following rules are not strict and consistency when using external types is preferred.

### Files
Use underscores for separation.
File suffix:
- C++: .cpp and .hpp
- C: .c and .h
- CUDA: .cu and .cuh

Example
`my_class.cpp`

### Types
Use camelcase and start with a capital letter.
Example
`using MyType = int;`

### Variables
Use camelcase and start with lower case
Example:
`int myValue = 0;`

#### Class / Struct Members
Use a trailing underscore for non-public member variables. Public members are mamed like normal variables.

#### Functions
Function names use underscores and are all lower case
Example:
`my_function(int);`

#### namespaces
Namepsace are all lower case and use underscores.
Example:
` namespace my_space {}`

#### Macros
Macros are all capital and use underscores.
Example:
`#define MY_MACRO_VALUE 1`