-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Standards
Michel Jung edited this page Nov 6, 2018
·
9 revisions
Within a group of developers working on the same projects, it is important that everyone follows the same coding standards. This page aims to document Java coding standards for Forged Alliance Forever as briefly as possible.
We try to detect and report as many violations with Codacy, though not all are possible. This list is being extended as violations are found during reviews.
When logging values, always decorate placeholders to distinguish them from normal words.
// Noncompliant - placeholder not decorated
logger.warn("Attribute {} has not been set", attribute);
- Produces
Attribute name has not been set
forattribute = "name"
, in which case we don't know if "name" is part of the sentence or if it's a value. - Produces
Attribute has not been set
forattribute = ""
, in which case we don't see that there's an empty value being logged.
logger.warn("Attribute '{}' has not been set", attribute);
logger.warn("Attribute has not been set: {}", attribute);
- Produces
Attribute 'name' has not been set
orAttribute has not been set: name
for attributeattribute = "name"
, which makes it clear that "name" is not part of the sentence but a value. - Produces
Attribute '' has not been set
orAttribute has not been set:
for attributeattribute = ""
, which makes it clear that there is an empty value.