Code style
We have not enforced any coding standard. However, we recommend
to adopt "best practices" for clean, simple, and logical codes.
- As the creator of C++ said, there is no coding standard
everyone agrees on. Check out Stroustrup's
FAQ.
- A few coding standards are emerging. See a sample header file
adopted by boost.org
- indentations: 2 space, disable tabs
- brackets
- loops
for (int i=0; i < n; ++i) { //do the loop }
- class names: choose the name that can mean something to
other developers
- WhatIsThisClass
- what_is_this_class
But, do not use both at the same time, e.g.,
What_Is_This_Class is like using bold-faced, itallc and color fonts in a document.
- local variable names: hide them as much as you can within
the current scope, all lower cases
|
ď Jeongnim Kim, Nov 29, 2010, 7:59 PM
|