Is "Code Conventions for the Java Programming Language" by Sun (1999) out of date? [closed]

StackOverflow https://stackoverflow.com/questions/22929851

  •  29-06-2023
  •  | 
  •  

Domanda

I have found Sun's Java code conventions which were lastly revised in 1999.

Is it out of date now?

È stato utile?

Soluzione

It's funny to ask this question exactly in the time when the guide is not available for unknown reasons. Perhaps it is being rewritten for Java 8?

Anyway, it's mostly still valid.

There are some controversial points (as in every styleguide) and there are lots of advice missing because of the last revision date (generics, enums, varargs, etc. - don't forget to have some conventions for those, too).

The main point is - you don't have to adhere to it religiously. Read it, let it sink in, try to use as much of it as possible for you and your team. If you find something that doesn't suit you, because you feel it's an outdated opinion, you can simply drop it. The only thing you have to be is consistent. If you start with one style, don't switch to another while still having old code.

By the way, there are many style guides out there. If you want something "new" (but a lot less thorough), see for example the very new Google styleguide.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top