CleanCode logo
NAVIGATION: first page in sectionprevious pageup one levelnext pagefinal page in section

Coding Guidelines

Students achieving Oneness will move on to Twoness.
Woody Allen

Writing clean code is a fine art, while at the same time, exacting in its nature. These rules will help with some of the latter, freeing you to focus on the former.


Consistent and appropriate naming of directories, files, modules, classes, functions, and variables provide several advantages:

Avoid repetition like the plague

Repetition in code is the vampiric garlic of the software world. It appears innocuous yet can cause great harm. And, it stinks. There are many avenues of condensing code; we explore a few of them here.

Memory impact may be positive or negative. Obviously less memory will be used if you have one copy of a complete function instead of two or more copies. But if you consolidate a code fragment as described above, you incur the overhead of additional function calls, using more memory when running. With well-written function declarations, however, function calls should not incur high overhead (TBD: see "clean function calls").


Conditional branching involves more than meets the eye, when it comes to design consideration. From the single if statement to the multiple if and the switch statements, there are issues with code clarity, performance, and maintainability to consider.


Proper handling of variables.


Functions are our friends.

Other Resources

Valid XHTML 1.0!Valid CSS!Get CleanCode at Fast, secure and Free Open Source software downloads
Copyright © 2001-2013 Michael Sorens • Contact usPrivacy Policy
Usage governed by Mozilla Public License 1.1 and CleanCode Courtesy License
CleanCode -- The Website for Clean DesignRevised 2013.06.30