Reasons for Code Conventions


These are Sun's reasons for code conventions:

  • Maintenance ” Most of the lifetime cost of software development goes to maintenance.

  • Changing author ” As the project size and software age increase, it becomes more likely that someone other than the original author will work on the code.

  • Readability ” Following consistent and clear conventions improves the software's readability and ease of maintenance.

  • Source code as a product ” Delivering a good product is hard, but shipping the code as part of the product is harder. The same need to present a clean and well-documented product applies to code because it is also part of the finished product.

There are other reasons to follow standard coding standards, but Table C.1 might offer the best reason to follow the advice in this appendix.

Table C.1. Code Style Grade Points for the Certification Assignment
 

Grade Area

Points

1

Coding standards and readability

23

2

Javadoc source documentation

5

3

Comments

5

4

Total

33 (21%)

Bad code style can be enough to fail the certification assignment. If you use a bizarre style or simply don't follow the industry standard for Java coding, you will upset the evaluator , who needs to find only one more thing wrong to give your project a terrible grade. There is no excuse for losing points in this area. You might find fault with the base code (some say it was done by an intern, but that is putting it too harshly) and the project parameters (some would like to see a real Java Database Connectivity [JDBC] assignment), but don't throw away points by using odd indentation and unclear language in your comments.

It doesn't take a high IQ to do well in this portion of the assignment; you simply need to dedicate adequate time to writing clean code and comments.



JavaT 2 Developer Exam CramT 2 (Exam CX-310-252A and CX-310-027)
JavaT 2 Developer Exam CramT 2 (Exam CX-310-252A and CX-310-027)
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 187

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net