Changes

Jump to: navigation, search

OOP344 - FjXR - 20102

1,599 bytes added, 16:08, 3 June 2010
no edit summary
=''We are FjXR, Code fixers are ready to go!''=
== Group member=={| class="wikitable sortable" border="1" cellpadding="5" align="centerauto"|+ OOP344 - FjXR - '''TERM 20102'''! ID !! First Name !! Last Name !! Section !! Seneca Id !! wiki id !! IRC nick !! Blog URL
|-
| A || [[User:Xlu44 | Xiongwen Lu ]] || xlu44 || A || [mailto:xlu44@learn.senecac.on.ca xlu44] || [[Special:Contributions/xlu44 | xlu44]] || xlu44 || [http://myoop344blog.blogspot.com/ my blog]
|-
| B || [[User:jpark68 | Junseok]] || Park|| A ||[mailto:jpark68@learn.senecac.on.ca Junseok] || [[Special:Contributions/jpark68 | jpark68]] || jpark68|| [http://jpark68.blogspot.com/ My Blog]
| D || [[User:Priya | Priya]] || Gill || A ||[mailto:pkgill5@learn.senecac.on.ca pkgill5] || [[Special:Contributions/priya | priya]] || pkgill5|| [http://rhui4.wordpress.com/ My Blog]
|-
| E || [[User:lwang168 | Liang Wang ]] || lwang168 || A || [mailto:lwang168@learn.senecac.on.ca lwang168] || [[Special:Contributions/lwang168 | lwang168]] || lwang168 || [http://lwang168.blogspot.com/ my blog]
|-
|}
== Notification Window ==
<!--<object width="250" height="360" id="obj_1275427285642"><param name="movie" value="http://fjxr.chatango.com/group"/><param name="wmode" value="transparent"/><param name="AllowScriptAccess" VALUE="always"/><param name="AllowNetworking" VALUE="all"/><param name="AllowFullScreen" VALUE="true"/><param name="flashvars" value="cid=1275427285642&b=60&f=50&l=999999&q=999999&r=100&s=1"/--><embed id="emb_1275427285642" src="http://fjxr.chatango.com/group" width="250" height="360" wmode="transparent" allowScriptAccess="always" allowNetworking="all" type="application/x-shockwave-flash" allowFullScreen="true" flashvars="cid=1275427285642&b=60&f=50&l=999999&q=999999&r=100&s=1"></embed><!--/object><br>[ <a href="http://fjxr.chatango.com/clonegroup?ts=1275427285642">Copy this</a> | <a href="http://chatango.com/creategroup?ts=1275427285642">Start New</a> | <a href="http://fjxr.chatango.com">Full Size</a> ]-->
== Coding Style ==
 
* References from the books of "Thinking in C++ (2nd Edition) by Bruce Eckel" and " Programming Windows with MFC (2nd edition) by Jeff Prosise, Microsoft Press "
* download the book here.<br/>
Thinking in C++,Volume 1, 2nd Edition by Bruce Eckel<br/>
http://matrix.senecac.on.ca/~jpark68/TIC2Vone.pdf <br/>
Volume 2: Standard Libraries & Advanced Topics<br/>
http://matrix.senecac.on.ca/~jpark68/TIC2Vtwo.pdf <br/>
== Coding Style ==
=== Common Hungarian Notation Prefixes ===
<p>
Prefixes are often combined to form other prefixes, as when '''p''' and '''sz''' are joined to form '''psz''', which stands for "pointer to zero-terminated string." </p>
<p>(See Example Below)</p>example:<p> int nCount = 45 ;<br/> char szUserName[20];<br/> char* pszUserName[20];<br/> char cLetter = 'a' ;<br/></p>
{| class="wikitable sortable" border="1" cellpadding="5" align="centerauto"
! Prefix !! Data Type
|-
| b || BOOL
|-
|}
 
 
=== File names ===
statement, etc.”). This is a single, consistent rule I apply to all of the
code I write, and it makes formatting much simpler. It makes the
“scannability” easier – when you look at this line:</p><br/> example:  int func(int a);<br/><br/>
<p>
you know, by the semicolon at the end of the line, that this is a
declaration and it goes no further, but when you see the line:</p>
<br/>example: int func(int a) {<br/><br/>
<p>
you immediately know it’s a definition because the line finishes
there’s no difference in where you place the opening parenthesis
for a multi-line definition:</p>
<br/>example:  int func(int a) {<br/> int b = a + 1;<br/> return b * 2;<br/> }<br/><br/><br/>
<p>and for a single-line definition that is often used for inlines:</p>
<br/>example: int func(int a) { return (a + 1) * 2; }<br/><br/>
<p>
Placing the ‘{‘ on the next line eliminates some confusing code
in complex conditionals, aiding in the scannability. Example:
</p>
<br/>example:  if(cond1<br/> && cond2<br/> && cond3) {<br/> statement;<br/> }<br/><br/>
<p>
The above has poor scannability. However,
</p>
<br/>example:  if (cond1<br/> && cond2<br/> && cond3)<br/> {<br/> statement;<br/> }<br/><br/><p>breaks up the ‘if’ from the body, resulting in better readability.
Finally, it’s much easier to visually align braces when they are
aligned in the same column. They visually "stick out" much
better.</p><br/><br/>
=== Identifier names ===
capitalizing each word. So a class looks like this:</p><br/><br/>
example: class FrenchVanilla : public IceCream {<br/><br/>
an object identifier looks like this:<br/><br/>
example: FrenchVanilla myIceCreamCone(3);<br/><br/>
and a function looks like this:<br/><br/>
example: void eatIceCreamCone();<br/><br/>
(for either a member function or a regular function).<br/>
=== Include guards on header files ===
and replacing the ‘.’ with an underscore. For example:</p><br/>
example:
<p> // IncludeGuard.h<br/>''' #ifndef INCLUDEGUARD_H'''<br/>''' #define INCLUDEGUARD_H'''<br/> // Body of header file here...<br/>''' #endif // INCLUDEGUARD_H'''<br/></p>
=== Use of namespaces ===
if you change the namespace outside of a function or class, you will cause
that change to occur for any file that includes your header,
resulting in all kinds of problems.
In cpp files, any global using directives will only affect that file,
and so you are generally used to produce more easilyreadable
code, especially in small programs.
example:
int main #include <cstdlib> // malloc() & free() { int i; int j; if #include <cstring> // memset(i == 0) { #include <iostream> i = 1 using namespace std; } }
1
edit

Navigation menu