Difference between revisions of "Team H - OOP344 - 20132"

From CDOT Wiki
Jump to: navigation, search
(Team Members)
(Team Members)
 
(14 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
=== Master Status ===
 
=== Master Status ===
 
* Master ('''last pushed/being pushed''') by ''Terry''
 
* Master ('''last pushed/being pushed''') by ''Terry''
** Added operator<< and operator>> methods; cleaned up strdsp
+
** Modified .gitignore
  
 
== Announcements ==
 
== Announcements ==
 
== Programming Style ==
 
== Programming Style ==
 +
 +
=== Automated Formatting ===
 +
 +
The majority of formatting rules can be applied automatically using the [http://astyle.sourceforge.net/ astyle] software.
 +
 +
<code>astyle --style=kr --convert-tabs --pad-header --pad-oper --add-brackets --brackets=linux --lineend=linux file.cpp</code>
 
=== Indentation===
 
=== Indentation===
* Indents made with tabs
+
* Indents made with spaces
* Tab size is four characters
+
* Indent size is four characters
=== Blocks ===
+
 
 +
=== Braces ===
 +
Braces should be made to match the K&R standard. This means that opening braces start on the same line as the expression that precedes them in all cases except for functions, and means that braces starting blocks should be one space away from the expression that precedes it.
 +
 
 +
Functions will have their opening brace on the line after the declaration, and this brace will be the only character on the line. Closing braces for all blocks should similarly sit alone on the ending line of the scope, except for related expressions like 'else'.
 +
 
 +
Bracing single-line blocks where it's not strictly necessary is strongly encouraged.
 +
 
 +
=== Parentheses ===
 +
Parentheses should be one space away from keywords such as 'if' and 'for', but should not be spaced when calling functions or operators. Essentially parentheses should be separate when they contain a condition, but attached when they contain an argument list.
 +
 
 +
=== Operators ===
 +
Binary operators should be spaced away from their operands, while unary operators should not. Exception: Membership and scope resolution operators should not be spaced.
 +
 
 +
=== Classes ===
 +
Classes must explicitly state the 'private:' tag for consistency even though not technically necessary. The private/protected/public order is preferred. These tags should not be indented relative to the class keyword.
 +
 
 +
=== Variable Naming ===
 +
lowerCamelCase names should be used such as:
 +
<syntaxhighlight lang="cpp">
 +
 
 +
curPos
 +
setPos
 +
row
 +
col
 +
</syntaxhighlight>
 +
 
 +
=== Demonstration ===
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
int main(){
+
class Console {
     char ch = '0';
+
private:
 +
    int _data;
 +
protected:
 +
 
 +
public:
 +
    Console();
 +
    ~Console();
 +
};
 +
 
 +
int foo() { // That brace should be on the next line
 +
    return sizeof (int); // This should be sizeof(int)
 +
}
 +
 
 +
int bar()
 +
{
 +
    if ( foo() ){ // This brace should be one space away from the if's condition...
 +
        return 3;
 +
    }else if ( bar() ){ // ...and so should these braces
 +
        return 2;
 +
    } else { // This is right
 +
        return 1;
 +
    }
 +
}
 +
 
 +
int main()
 +
{
 +
     char someChar = '0';
 
     int i;
 
     int i;
  
     for(i=0; i<10; i++){
+
    // Although K&R allows for this...
 +
     for (i=0; i<10; i++)
 
         cout << i;
 
         cout << i;
 +
 +
 +
    // ...please do this instead
 +
    if ( foo() ) {
 +
        bar();
 +
    } else {
 +
        someChar = 'a';
 
     }
 
     }
  
     switch(ch) {
+
     switch(someChar) { // switch is a keyword, so it should be switch (someChar)
     case 0:
+
     case '0':
 
         cout << 0;
 
         cout << 0;
 
         break;
 
         break;
     case 1:
+
     case 'a':
 
         cout << 1;
 
         cout << 1;
 
         break;
 
         break;
 
     }
 
     }
 +
 +
    someChar+4; // Should be someChar + 4
 +
    ! i; // Should be !i
  
 
   return 0;
 
   return 0;
 
}</syntaxhighlight>
 
}</syntaxhighlight>
=== Classes ===
 
<syntaxhighlight lang="cpp">
 
class Console {
 
private:
 
 
public:
 
    Console();
 
    ~Console();
 
}
 
</syntaxhighlight>
 
=== Variable Naming ===
 
Lower Camel Case
 
<syntaxhighlight lang="cpp">
 
curPos
 
setPos
 
row
 
col
 
</syntaxhighlight>
 
  
 
== Team Members ==
 
== Team Members ==
Line 60: Line 112:
 
|[[User:Drew Terrance Kerr | Drew Terrance]]|| Kerr ||A||[mailto:dtkerr@myseneca.ca?subject=oop344- dtkerr]||[[Special:Contributions/Wiki ID|Drew Terrance Kerr]]||Praefractus||TerryKerr|| [http://dtkerroop344.wordpress.com dtkerr]
 
|[[User:Drew Terrance Kerr | Drew Terrance]]|| Kerr ||A||[mailto:dtkerr@myseneca.ca?subject=oop344- dtkerr]||[[Special:Contributions/Wiki ID|Drew Terrance Kerr]]||Praefractus||TerryKerr|| [http://dtkerroop344.wordpress.com dtkerr]
 
|-
 
|-
|[[User:Chisa Takata | Chisa]]|| Takata ||A||[mailto:ctakata@myseneca.ca?subject=oop344- ctakata]||[[Special:Contributions/Wiki ID|Chisa Takata]]||chisatakata||chisat|| [http://chisa-takata.tumblr.com chisat]
+
|[[User:Chisa Takata | Chisa]]|| Takata ||A||[mailto:ctakata@myseneca.ca?subject=oop344- ctakata]||[[Special:Contributions/Chisa Takata|Chisa Takata]]||chisat||chisat|| [http://chisa-takata.tumblr.com chisat]
 +
|-
 +
|[[User:Jaejin Lee | Jaejin]]|| Lee ||B||[mailto:jlee334@myseneca.ca?subject=oop344- jlee334]||[[Special:Contributions/Wiki ID|Jaejin Lee]]||jaejin||jaejinlee|| [http://jlee334.wordpress.com/ jlee334]
 
|-
 
|-
 
|}
 
|}
 +
 +
*Drew Terrance Kerr:
 +
**CLineEdit
 +
**CValEdit
 +
**CMenu
 +
**CCheckList
 +
 +
*Jaejin Lee
 +
**CButton 
 +
**CText
 +
**CCheckMark
 +
 +
*Chisa Takata
 +
**CDialog
 +
**CLabel
 +
**CMenuItem
  
 
== Discussions ==
 
== Discussions ==

Latest revision as of 13:10, 10 July 2013

Modify this page to the needs of your team.
OOP344 | Weekly Schedule | Student List | Teams | Project | Student Resources

Repository

Master Status

  • Master (last pushed/being pushed) by Terry
    • Modified .gitignore

Announcements

Programming Style

Automated Formatting

The majority of formatting rules can be applied automatically using the astyle software.

astyle --style=kr --convert-tabs --pad-header --pad-oper --add-brackets --brackets=linux --lineend=linux file.cpp

Indentation

  • Indents made with spaces
  • Indent size is four characters

Braces

Braces should be made to match the K&R standard. This means that opening braces start on the same line as the expression that precedes them in all cases except for functions, and means that braces starting blocks should be one space away from the expression that precedes it.

Functions will have their opening brace on the line after the declaration, and this brace will be the only character on the line. Closing braces for all blocks should similarly sit alone on the ending line of the scope, except for related expressions like 'else'.

Bracing single-line blocks where it's not strictly necessary is strongly encouraged.

Parentheses

Parentheses should be one space away from keywords such as 'if' and 'for', but should not be spaced when calling functions or operators. Essentially parentheses should be separate when they contain a condition, but attached when they contain an argument list.

Operators

Binary operators should be spaced away from their operands, while unary operators should not. Exception: Membership and scope resolution operators should not be spaced.

Classes

Classes must explicitly state the 'private:' tag for consistency even though not technically necessary. The private/protected/public order is preferred. These tags should not be indented relative to the class keyword.

Variable Naming

lowerCamelCase names should be used such as:

curPos
setPos
row
col

Demonstration

class Console {
private:
    int _data;
protected:

public:
    Console();
    ~Console();
};

int foo() { // That brace should be on the next line
    return sizeof (int); // This should be sizeof(int)
}

int bar()
{
    if ( foo() ){ // This brace should be one space away from the if's condition...
        return 3;
    }else if ( bar() ){ // ...and so should these braces
        return 2;
    } else { // This is right
        return 1;
    }
}

int main()
{
    char someChar = '0';
    int i;

    // Although K&R allows for this...
    for (i=0; i<10; i++)
        cout << i;


    // ...please do this instead
    if ( foo() ) {
        bar();
    } else {
        someChar = 'a';
    }

    switch(someChar) { // switch is a keyword, so it should be switch (someChar)
    case '0':
        cout << 0;
        break;
    case 'a':
        cout << 1;
        break;
    }

    someChar+4; // Should be someChar + 4
    ! i; // Should be !i

  return 0;
}

Team Members

Add table rows by replacing sample table row, cell values with yours

OOP344 - Team name
First Name Last Name Section Seneca Id & email wiki id IRC nick GITHUB ID Blog URL
Drew Terrance Kerr A dtkerr Drew Terrance Kerr Praefractus TerryKerr dtkerr
Chisa Takata A ctakata Chisa Takata chisat chisat chisat
Jaejin Lee B jlee334 Jaejin Lee jaejin jaejinlee jlee334
  • Drew Terrance Kerr:
    • CLineEdit
    • CValEdit
    • CMenu
    • CCheckList
  • Jaejin Lee
    • CButton
    • CText
    • CCheckMark
  • Chisa Takata
    • CDialog
    • CLabel
    • CMenuItem

Discussions