You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Apache Wiki <wi...@apache.org> on 2017/02/12 14:32:31 UTC

[Jmeter Wiki] Update of "CodeStyleGuidelines" by ham1

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jmeter Wiki" for change notification.

The "CodeStyleGuidelines" page has been changed by ham1:
https://wiki.apache.org/jmeter/CodeStyleGuidelines

Comment:
Initial draft

New page:
In order to improve readability ([[https://dzone.com/articles/why-code-readability-matters|Why readability matters]]) here are some code style guidelines for the JMeter project.

== Java ==

 * 4 spaces for indentation
    * No tabs <!>
 * "Soft" line length of ~80
    * "Hard" line length of 120
      * Except for imports or other places where breaking the line wouldn't aid readability
 * Spacing between elements on a line e.g.
   * `if (...`
   * `while (...`
   * `methodCall(arg1, arg2)`
   * `"con" + "cat"`
 * Braces are always used with `if`, `else`, `for`, `do` and `while` statements, even when the body is empty or only a single statement
 * Import order
 * Import spacing 
 * No `.*` imports
 * Line length of methods (soft limit of 50?)
 * Line length of classes (soft limit of 500?)

=== Java 8 Specific ===

 * Use of Optional
 * Default/static methods on Interfaces
 * Lambdas where possible (max ~5 lines)

== See Also ==

https://google.github.io/styleguide/javaguide.html