Coding Standards: A Presentation by Jordan Belone
Coding Standards: A Presentation by Jordan Belone
Coding Standards: A Presentation by Jordan Belone
• Guidelines - Should
• Physical Document
Open Source
• GNU
http://www.gnu.org/prep/standards/standards.html
• Firefox
https://developer.mozilla.org/En/Developer_Guide/Cod
ng_Style
Prominent Works
-Kernighan and Plauger (1974)
- Regarded as “a business
essential” and has been
proven to save money
-C/C++/Java
Kernighan Quotations
• BY LANGUAGE
Common Practice - Indentation
• Identifies scope in some programming languages
for the compiler
• Indentation of
– Functions
– Objects
– Etc
To
if (g < 17 && h < 22 || i < 60)
{ - Easier to Read
return true;
} - Easier to Understand
else
{ - Easier to maintain
System.out.println(“incorrect”);
return false;
}
Common Practice -Commenting Code
• ALL PROGRAMMING LANGUAGES
• Comments should
- Clearly demonstrate the function of the code,
both to yourself and to other developers
- Not too long
• Comments should NOT be
- Every line (Exceptions for functional languages)
- Overcomplicated
Common Practice - Whitespace
• Very important but often overlooked
• LOOKING FORWARD