Google's Java coding standards

Yep, Google's got standards when it comes to Java coding, and they've been carefully documented for your enlightenment. While these enforceable coding conventions are clearly most relevant to Java developers interested in joining the Googleplex, they're also a good indicator of what you might expect to see in other shops. InfoQ's Bienvenido David lists some of the rules gleaned from the Google Java Style guide:

  • No wildcard imports.
  • Overloads appear sequentially.
  • Braces are used even when the body is empty or contains a single statement.
  • Two space indentation.
  • Column limit can be 80 or 100 characters.
  • No C-style array declarations.
  • Default statements required in switch statements.
  • Modifiers appear in the order recommended by the Java Language Specification.
  • Constants use CONSTANT_CASE. Note that every constant is a static final field, but not all static final fields are constants.

Read more on InfoQ and check out the Google Java Style guide ...

This story, "Google's Java coding standards" was originally published by Java Everywhere.

Recommended
Join the discussion
Be the first to comment on this article. Our Commenting Policies
See more