Java coding style to help ensure a uniformly high source code quality, so we always need to review our code keep readable, understandable. clearfully check every lines coding style. this article summarizes why Java coding style and guidelines is so much important? and next articles we will get some detail rules and guiding principles to archieve this goal.
Correctness: The java coding works correctly. This item might seem superfluous, but experience tells us differently.
Efficiency: REVISIT – This does not refer to the number of java source code lines, but to the total size of compiled code (the .class files). It also includes overhead imposed by non-functional data, e.g., strings used internally in the program. Traditionally, size also includes memory usage.
Performance: This includes both execution time (as measured by CPU usage) and perceived responsiveness from the user€™s point of view. A general guideline is to make the implementation fast enough, but not to waste time making it faster than that.
Robustness: Tolerance towards erroneous input and other error conditions. This does not mean that a program or routine should accept garbage, but that is should handle it gracefully.
Safety: Choose the implementation that you are most likely to develop without any bugs.
Maintainability: Code that is easy to maintain typically has several characteristics:
(1).It is easy to read and understand.
(2).It is well encapsulated. This allows changes (updates or fixes) to be made with some confidence that it won€™t blow up something else.
(3).Documentation, including comments in the code, is in agreement with the code.
Reusability: Designing for reuse typically has an overhead of around 50%, split among additional design time (to find good generalizations), additional documentation requirements and additional testing. A good compromise is often just to choose a design that does not preclude reuse; the best tool for this is known as encapsulation.
Portability: Java Coding style guidelines for portability typically entails such things as:
(1).Using a cross-platform library
(2).Using a subset of a language or library that is common and consistent across platforms
(3).Isolating platform dependencies
In the specific case of Java, we need to accommodate differences between Java VM implementations, differences between library implementations and differences between host GUIs.
Above 8 aspects have already let you know that doing clean and high-quality codes are so much important? if yes please earnestly read next implemention about imporving Java coding style guidelines.