Skip to content

Commit 1cab8d4

Browse files
authored
Update coding-conventions.asciidoc
1 parent 8f1e957 commit 1cab8d4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

documentation/coding-conventions.asciidoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ We follow these additional naming rules:
2121
* Names of Generics should be easy to understand. Where suitable follow the common rule `E=Element`, `T=Type`, `K=Key`, `V=Value` but feel free to use longer names for more specific cases such as `ID`, `DTO` or `ENTITY`. The capitalized naming helps to distinguish a generic type from a regular class.
2222
* For `boolean` getter methods use `is` prefix instead of `get` but for `boolean` variable names avoid the `is` prefix (`boolean force = ...` instead of `boolean isForce = ...`) unless the name is a reserved keyword (e.g. `boolean abstract = true` will result in a compile error so consider using `boolean isAbstract = true` instead).
2323

24+
== Proper IDE configuration
25+
Ensure your IDE (IntelliJ, Eclipse, VSCode, ...) is properly configured.
26+
This is what https://github.com/devonfw/IDEasy[IDEasy] is all about.
27+
A reasonable configuration of formatter, save actions, etc. will ensure:
28+
29+
* no start imports are used (`import java.util.*`)
30+
* no diff-wars in git (if every developer in the team uses the same formatter settings the diffs in git will only show what really changed)
31+
* import statements are properly grouped and sorted
32+
* code has properly indentation and formatting (e.g. newlines after opening curly braces)
33+
2434
== Obsolete APIs
2535
Please avoid using the following APIs:
2636

@@ -169,7 +179,7 @@ public class MavenDownloader {
169179
public void download(String url) { ... }
170180
}
171181
----
172-
Here `url` is used as a constant however it is not declared as such.
182+
Here `url` is used as a constant however it is not declared as such. Other classes could modify the value (`MavenDownloader.url = "you have been hacked";`).
173183
Instead we should better do this:
174184
[source,java]
175185
----

0 commit comments

Comments
 (0)