www.XuvTools.org
XuvTools Coding Style Guidelines / RecommendationsHere is some example C++ code that should help you getting started. Coding style is not strict, but please try to stick to these guidelines in order to avoid obliteration. // Return type, class quantifier and function name all go on separate lines. // Function arguments are CamelCase, but start with a small letter 'a'. bool MyClass:: ParseTimePointAndChannel(size_t& aTimePoint, size_t& aChannel) { // Indent with two spaces. No tabs, and no more than two spaces. aTimePoint = 0; aChannel = 0; return false; } void MyClass:: ProcessData() { // Don't make spaces before or after opening round brackets. for(size_t vIndex = 0; vIndex < varNames.size(); ++vIndex) { // Local variables are CamelCase, but start with a small letter 'v'. size_t vTimePoint; size_t vChannel; // Always add curly braces on loops and conditions. The // curly brackets can go on the same or on the next line. if(ParseTimePointAndChannel(vTimePoint, vChannel)) { std::cout << "MyClass::ProcessData(): Could parse" << " timepoint and channel" << std::endl; } else { // Try quantizing the namespace on the function, rather // than using 'using namespace xxx'. std::cerr << "MyClass::ProcessData(): Error parsing" << " timepoint and channel" << std::endl; } } } |
|||
|