|
Services: Coding Style
Many programmers have different styles of coding.
We are very concious of consistency and coding conventions.
We will use your coding style, or if you do not have one Code Triangle has an internal coding style.
This will keep our code consistent and readable so more features can be added in the future.
We have found that consistency is one of the most important parts of any software development project.
Our method is based on the Linux Kernel coding style defined in the "CodingStyle" document included with the Kernel's source.
Their method is based on the Kernighan and Ritchie (K&R) style.
Please read the "CodingStyle" document, as it has much more information than this page.
Example
// SampleFunction ///////////////////////////////////////////////////////////////
// This sample function multiplies both parameters and returns the product.
// Parameters must be greater than 0 or the result will be 0.
int SampleFunction(int left, int right)
{
// validate input
if (left == 0 || right == 0) {
return 0;
}
return left * right;
}
|