VPR-Docs/Docs/coding guide.md

46 lines
1.0 KiB
Markdown
Raw Normal View History

2021-11-16 12:22:17 +01:00
# 1 Formatting
2021-11-16 11:01:40 +01:00
## 1.1 General
2021-11-28 19:38:20 +01:00
Maximal 80-100 letters in one line
We use the default build in Formatter from 'IntelliJ IDEA' (Ctr+Alt+L)
2021-11-16 11:01:40 +01:00
## 1.2 Brackets
Brackets will be used like this:
public void example() {
}
## 1.3 Arrays
2021-11-16 11:01:40 +01:00
String[] array = new String[]{"1", "2", "3", "4"}
or
String[] array = new String[]{
"1",
"2",
"3",
"4"
}
2021-11-16 10:46:07 +01:00
# 2 Naming
## 2.1 General
2021-11-16 12:21:49 +01:00
Names should only include ASCII letters and digits. They should never begin with a digit.
All names should _ALWAYS_ be in english.
2021-11-16 10:46:07 +01:00
## 2.2 Class names
2021-11-16 12:21:49 +01:00
Class names are written in UpperCamelCase.
2021-11-16 10:46:07 +01:00
## 2.3 Method names
2021-11-16 12:21:49 +01:00
Method names are written in lowerCamelCase.
They are often verbs describing the function of the method e.g. _startProcess_ or _log_.
2021-11-16 10:46:07 +01:00
2021-11-16 11:03:05 +01:00
## 2.4 Constant names
2021-11-16 12:21:49 +01:00
Constant names are written in UPPER_CASE.
## 2.5 Variable names
Variable names are written in lowerCamelCase.
The names should _ALWAYS_ be words that are descriptive.
## 2.6 File names
File names are written in lowerCameCase.