3. Why
• 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
5. Program design
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
6. Naming conventions
• 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
7. Naming convention in Java
Java follows camelcase syntax for naming
Type Convention
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
etc.
Package Should be in lowercase letter e.g. java, lang, sql, util etc.
Constants Should be in uppercase letter. e.g. RED, YELLOW,
MAX_PRIORITY etc.
8. Documentation
(Comments)
• 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
forgotten.
9. Documentation
(Comments)
• 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
• Classes
– Comment at the beginning of the class about what the class does
Ex:
class Employee
// this class is used to manage all information
// about employees and retrieve specific data
10. Documentation
(Comments)
• 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