OpenMRS

Move this trailing comment on the previous empty line.

Move this comment https://github.com/openmrs/openmrs-core/blob/master/web/src/main/java/org/openmrs/module/web/ModuleServlet.java#L47 to the empty line above, such that it is on its own line. Background Information: Comments should not be located at the end of lines of code This rule verifies that single-line comments are not located at the end of a line of code. The main idea behind this rule is that in order to be really readable, trailing comments would have to be properly written and formatted (correct alignment, no interference with the visual structure of the code, not too long to be visible) but most often, automatic code formatters would not handle this correctly: the code would end up less readable. Comments are far better placed on the previous empty line of code, where they will always be visible and properly formatted.

Therefore, instead of this: int a1 = b + c; // This is a trailing comment that can be very very long

Make it like this: // This very long comment is better placed before the line of code int a2 = b + c;

Task tags

  • coding

Students who completed this task

Nathan Schnitzer

Task type

  • code Code
close

2017