Java Programming Style Guide
This Style Guide describes the coding standards,
conventions, and guidelines used this semester for
writing correct, high-quality, and maintainable Java code. They are based
on industry standards,
although reduced to a simplified form to teach the concepts yet
keep the work load reasonable. By following these principles, you will
be better able to produce code that is correct, requires less debugging
effort, and is easier for the grader to follow.
In the real-world, code conventions are important to programmers for
a number of reasons:
- 80% of the lifetime cost of a piece of software goes to maintenance.
Hardly any software is maintained for its whole life by the original
author. Code conventions improve the readability of the software,
allowing programmers to understand new code more quickly and
thoroughly.
- Coding standards allow teams of programmers to
more easily understand each others code and help spot errors. Rather
than coding from scratch, team members are more likely to share and
re-use code when the style and commenting conventions among team
members are the same.
In this course, code conventions are important for a number of
reasons:
- It is important to learn
correct coding practices from the beginning rather than
adopting bad coding habits that will need to be corrected down the road.
- Care in following the coding conventions will reduce the
number of logic errors in your code as well as reduce the
debugging time required to fix your remaining logic errors.
- Your code is read by the grader and instructor. They will
have an easier time understanding your code's logic
and helping you debug your errors if everyone follows a consistent set
of standards.