Open main menu

CDOT Wiki β

Changes

OOP344 - Team Nothing - 20102

626 bytes added, 21:34, 30 May 2010
m
no edit summary
=4.0 Conventions and Styles=
==4.1 Function Conventions=====4.1.1 Function Naming Convention===Function names are all lowercase and each word are is separated by a _an underscore character.
<pre>
int do_something()
{
code;
}
</pre>
 
===4.1.2 Function Comments===
Each function definition should include a comment above it that includes the function name, a brief and clear description of what each variable does in the function, and a clear and concise description of what the function does.
<pre>
/*
* Function Name: function_name
* Description: This is a clear and concise function description.
* Variable: variable1 - this variable holds the value of something for some purpose
* variable2 - this variable holds the value of something else for some other purpose
*/
int function_name()
{
 
code;
 
}
</pre>
==4.2 Variable ConventionConventions==
===4.2.1 Naming Convention===
Similar to the [[OOP344_-_Team_Nothing_-_20102#4.1 Function Naming Convention|4.1 Function Naming Convention]]
For CompoundVariable Names:
<pre>
int some_var;
OR
For SingleNon-compound Variable Names:
<pre>
int var;
</pre>
===4.2.2 CreatingVariable Definitions===Each Define each variable should be on it's own a speparate line.
<pre>
</pre>
==4.3 Indent Level==The indent level in any case will consist of three spaces. There will be no tab use. <pre>int someFunction{  code; more code; }</pre> ==4.4 File HeadingHeadings==Each file with the extension of *.cpp, *.c, and *.h must include a comment heading at the beginning of the file stating the file name, author (and username), date created, last modified date, and description of what the file does. The description should be clear and concise. This must be enclosed using /* and */.
<pre>
/*
* File Name: example.cpp
* Author: Name (senecaidseneca id) * Create DateCreated: 23-May-10
* Last Modified Date: 11-Nov-10
* Description: blah blah blahThis is a clear and concise description of the file.
*/
</pre>
 ==4.5 Function Comments4 Indentation Level==Each function should include a comment above the function similar to the file heading ([[OOP344_-_Team_Nothing_-_20102#4Use an indentation level of three spaces in all situations.4 File Heading|4Do not use TAB for indentation.4 File Heading]]), except only including the function name, what each variable does in the function, and a description of what the function does 
<pre>
/* * Function Name: function_name * Description: Blah blah blah. * Variable: variable1 - this does this to this function * variable2 - this is 2 */int function_namesome_function()
{
code; more code;
}
</pre>
==4.6 5 Curly Braces==Use of Each { and } in for a code block, such as in an if statement, or a for loop, should start be placed on a new its own separate line, with the { and } lined up with the first character of the line above it. If the code block consists of only has one coded line for the resultof code, please continue to use the curly brackets anyways braces for readability’s sakeclarity and in case additional code is added afterwards.
<pre>
void function()
</pre>
==4.7 6 Conditional Compilation=====4.6.1 Naming Convention for Header Files===Prefix the names of header files that we create with "tn" (initials of Team Nothing) followed by an underscore character. For example, tn_headerfile.h When using conditional comiplation, use the following format for a file named tn_headerfile.h:
<pre>
#ifndef _tn_headerfilename_h_tn_headerfile_h_#define _tn_headerfile_h_
</pre>
1
edit