• The rework time in coding is the actual killer
• 20-25% of the time is spent in reworking in software –
that means, fix the mistakes done
It helps in
• Greater consistency between developers
• Easier to develop and maintain
• Saves time and money
1. Program Design
2. Naming Conventions
4. Formatting Conventions
Way of organizing the component structure, data
structure, and control structure.
• Use standard architectures
– Eg: MVC
• Type of data storage
• Use of algorithms and flowchart
• Use full English descriptors
• Use mixed case to make names readable
– Camel casing and pascal casing
– Or use underscore for separation
• Avoid long names
• Avoid leading/trailing underscores
Naming convention in Java
Java follows camelcase syntax for naming
Class Should start with uppercase letter and be a noun e.g. String,
Color, Button, System, Thread etc.
Interface Should start with uppercase letter and be an adjective e.g.
Runnable, Remote, ActionListener etc.
Method Should start with lowercase letter and be a verb e.g.
actionPerformed(), main(), print(), println() etc.
Variable Should start with lowercase letter e.g. firstName, orderNumber
Package Should be in lowercase letter e.g. java, lang, sql, util etc.
Constants Should be in uppercase letter. e.g. RED, YELLOW,
• Commenting is necessary for maintaining any program
• Without commenting, the program is not complete
• Do not assume that the other person who reads this
program will understand it clearly
• If commenting is not done at the beginning, it is
• Program - a physical file – you need to comment the
following at the top.
– at the top of the program - header comment
– what the program achieves
– who coded on what day
– Comment at the beginning of the class about what the class does
// this class is used to manage all information
// about employees and retrieve specific data
• Methods within classes
– what this method/function/procedure does
– what are the parameters and their purpose
– what are the return values
• Comment before every loop.
• Comment before every file or database operation
• Comment before every if condition
• White space
• Opening and closing the braces/ block