Link https://openjdk.org/projects/amber/guides/lvti-style-guide

P1. Reading code is more important than writing code.

P2. Code should be clear from local reasoning.

P3. Code readability shouldn’t depend on IDEs.

P4. Explicit types are a tradeoff.

Guidelines

G1. Choose variable names that provide useful information.

G2. Minimize the scope of local variables.

G3. Consider var when the initializer provides sufficient information to the reader.

G4. Use var to break up chained or nested expressions with local variables.

G5. Don’t worry too much about “programming to the interface” with local variables.

G6. Take care when using var with diamond or generic methods.

G7. Take care when using var with literals.

javavarcodestylepractice