Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [Original edit by ham1]

In order to improve readability (Why readability matters) here are some code style guidelines for the JMeter project.

Java

We now enforce many of these rules, and more using checkstyle.

Indentation/White space

  • 4 spaces for indentation
    • No tabs (warning)
  • "Soft" maximum line length of ~80 characters
    • Editors and monitors used by most programmers with good eyes can easily handle 120 characters. However:
      • lines longer than this can be harder to read and frustrating work with
      • not all programmers have good eyes and/or wide high resolution monitors
      • in typography line length is recommended to be 45-75 with the optimum being 66 or 45-90
    • Here is an example from UrlConfigGui.java
      • which do you find easier to read?

...

  • Parameter descriptions are aligned and not on new lines.
  • No invalid tags
  • No tags without a description
  • Blank line after main description but not after any tags

Other

  • Import order
    • TBCjava, javax, org, net, com, others
  • Import spacing
    • TBCline break between each group
  • No wildcard (.*) imports
  • Method line length (soft limit of 50)
  • Class line length (soft limit of 500)

...