In order to improve readability (Why readability matters) here are some code style guidelines for the JMeter project.
Java
- 4 spaces for indentation
- No tabs
- 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
- "Hard" line length of 120
- Spacing between elements on a line e.g.
if (...
while (...
methodCall(arg1, arg2)
"con" + "cat"
- Braces are always used with
if
,else
,for
,do
andwhile
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)