Coding standards for Java is something which is very significant in achieving greater reliability within your coding and also the codes of others who are working in our team. Keeping superior standards while coding leads to more legibility,easiness in building and also to keep up the pace of development. This also will reduce the overall cost of application that you are trying to generate.
1. Good Name
  • Use full English descriptors that would exactly illustrate the variable/field/class/… which you are trying to declare.
  • The use of mixed case will affect the clarity of the code.
  • Use abbreviations where there is no other option except to use it, but if you do so then use them wisely.
  • Avoiding of very long names ie, words with 15 characters or less is apt.
  • Don’t try the use of words that are similar according to the outcome you are trying to achieve.
  • It would be better if you capitalize the standard acronyms.
  • 2. Good Documentation
  • Comments should be added so that legibility of your code is improved.
  • Avoid unnecessary use of characters.
  • Keep comments such a way that it is easy to understand.
  • Document your work before you write the code.
  • 3. Standards for Member Functions
  • Naming Member Functions : Name of member function should be meaningful,must be in well format. We can use mixed case letter as first non-initial character should be capitalized. For example insert(),call() etc
  • Member Function Visibility : For a good design wherever you minimize the union of classes, the general rule of thumb is to be more limiting as possible when setting the visibility of a member function. If member function need not be public then make it protected, else if it has to be protected then make it private.
  • Documenting Member Functions : The manner, by which you document a member function, will be the underlying factor that would affect its clarity, maintainability and extensibility.
  • 4. Java Coding Style
  • Categorizing Your Code Sensibly.
  • Placing the Constants on the Left Side of comparison is a good option.
  • 5. Java Documentation Conventions
    Before starting a documentation work it would be better if you ask yourself the following questions. The first one would be whether you’ve never seen the code before, and the second would be what information that u need understand in code for a reasonable amount of time.
    General Concepts:
  • Comments should be added to achieve more clarity in your code
  • Remember the saying ‘If your program isn’t worth documenting, it probably isn’t worth running’.
  • For documentation, decorations are not used.
  • Keep comments simple
  • Document before you write the code
  • Document why something is being done, not just what has done.