-
Notifications
You must be signed in to change notification settings - Fork 2
Coding Conventions
In general, we follow the java Java Code Conventions.
In the following are noteworthy divergences or additions which we use in our codebase:
Write fluently readable code! We mean by this: Before following a rule, think about the usage of the part of the API you are developing and think how a usage example would look like. Always make sure, that the clause in the usage example reflects as precisely the task the code is performing.
In general, we do not use any prefixes for getters and setters (get..., is..., set...). First of all, we basically almost never have setters in the codebase in any case, because we use immutable objects wherever possible. Secondly, we think that it makes the code more concise and readable. E.g. for example, if an object would have a property 'value' of type Double, an corresponding line to read this value would read like:
Double value = object.value();
Sometimes though it turns out to be useful to stick to the 'is' convention for boolean getters, as it can make the code more fluently readable. However, sometimes other words are used, like 'has', 'can', ... etc. We are not fully strict in this, but what should definitely be avoided are constructs like 'isCanApply()', 'isShouldKeep()', or similar.