File Naming:
-
Back to Top
- There will be NO spaces in any filenames or directories.
Right:
/ AIAHealSupport / AIAHealSupport.cpp
Wrong:
/ HealSupport Template class / AI AHeal Support.cpp
Formatting:
-
Back to Top
- Use spaces, not tabs. Tabs should only appear in files that require them for semantic meaning, like Make files.
- The indent size is 3 spaces.
- In a header, code inside a class should be indented.
- keywords such as public, private, protected and friend should also be indented.
- A single blank line should be placed after those keywords.
- Any friend keywords should appear at the bottom of a class definition below any other code.
- In a header (.hpp, .h) file, code inside a namespace should be indented.
- In an implementation (.cpp, .c) file, code inside a namespace should not be indented.
- A case label should be indented from its switch statement.
- A case statement's contents are indented from the case.
- The colon after a case statement should have no spaces before or after it.
- Use parenthesis in complex mathmatical formulae and expressions.
- It is important to make it easy for future readers of this code to visualize and modify order of operations.
- Use parenthesis in complex logic and conditional expressions.
- It is important to make it easy for future readers of this code to visualize and modify order of operations.
Right:
int main() { return 0; }
Wrong:
int main() { return 0; }
Right:
class CDocumention { public: Document(); ... friend class CEffectList; };
Wrong:
class CDocumention { friend class CEffectList; public: Document(); ... };
Right:
namespace Whiptail { class CDocumention { public: Document(); }; };
Wrong:
namespace Whiptail { class CDocumention { public: Document(); }; };
Right:
namespace Whiptail { CDocumention::Document() { } };
Wrong:
namespace Whiptail { CDocumention::Document() { } };
Right:
switch (condition) { case mostLikelyCondition: case leastLikelyCondition: i++; break; default: i--; }
Wrong:
switch (condition) { case leastLikelyCondition: case mostLikelyCondition: i++; break; default: i--; }
Right:
pfloat32 myValue = (pV0->vx * w0) + ( pV1->vx * w1) + (pV2->vx * w2) + (pV3->vx * w3);
Wrong:
pfloat32 myValue = pV0->vx * w0 + pV1->vx * w1 + pV2->vx * w2 + pV3->vx * w3;
Right:
if ((pAudio->pBuffer[0] == 'R') && (pAudio->pBuffer[1] == 'I') && (pAudio->pBuffer[2] == 'F') && (pAudio->pBuffer[3] == 'F'))
Wrong:
if (pAudio->pBuffer[0] == 'R' && pAudio->pBuffer[1] == 'I' && pAudio->pBuffer[2] == 'F' && pAudio->pBuffer[3] == 'F')
Spacing:
-
Back to Top
- Do not place spaces around unary operators.
- Do place spaces around binary operators
- Do place spaces around ternary operators
- Do Place spaces between control statements and their parentheses.
- Do Place spaces between each of a functions parameters.
- Do not place spaces between a function and its parentheses, or between a parenthesis and its content.
Right:
i++;
Wrong:
i ++;
Right:
y = m * x + b / n; f(a, b); c = a | b;
Wrong:
y=m*x+b/n; f(a,b); c = a|b;
Right:
return condition ? 1 : 0;
Wrong:
return condition ? 1:0;
Right:
if (condition)
Wrong:
if(condition)
Right:
f(a, b, c, d);
Wrong:
f(a,b,c,d);
Right:
f(a, b);
Wrong:
f (a, b); f( a, b );
Line breaking:
-
Back to Top
- Each statement should get its own line.
- An
else
statement should go on it's own line separate from closing and opening braces. - An
else if
statement should be written as anif
statement when the priorif
concludes with areturn
statement.
Right:
x++; y++; if (condition) { DoSomething(); }
Wrong:
x++; y++; if (condition) DoSomething();
Right:
if (condition) { ... } else { ... }
Wrong:
if (condition) { ... } else { ... }
Right:
if (condition) { ... return someValue; } if (condition) { ... }
Wrong:
if (condition) { ... return someValue; } else if (condition) { ... }
Braces
-
Back to Top
- Function definitions should have each brace on its own line.
- Class definitions should have each brace on its own line and the final brace should be followed by a semicolon.
- Namespaces should have each brace on its own line and the final brace should be followed by a semicolon.
- One-line control clauses should use braces
- Control clauses without a body should be avoided but when used should use an empty set of braces and not a trailing semicolon.
Right:
int main() { ... }
Wrong:
int main() { ... }
Right:
class CDocumentation { ... };
Wrong:
class CDocumentation { ... }
Right:
Namespace Whiptail { ... };
Wrong:
Namespace Whiptail { ... }
Right:
if (condition) { DoSomething(); }
Wrong:
if (condition) DoSomething();
Right:
for (; current; current = current->next) { }
Wrong:
for (; current; current = current->next);
Types & Values:
-
Back to Top
- The null pointer value should be written as
NULL
. bool
values should be written astrue
andfalse
.- Do not use the Objective-C style
BOOL
type. - Tests for true/false and zero/non-zero should all be done without equality comparisons.
- Do not add explicit initializations to temporary variables if you assign to them before testing their value.
- These are the only allowed 8 bit types used in runtime structures, as data members and in code.
- These are the only allowed 16 bit types used in runtime structures, as data members and in code.
- These are the only allowed 32 bit types used in runtime structures, as data members and in code.
- bool is a special case it can be used in runtime code but not in structures and not as a data member.
- pfloat32 is an internal type which can be a float or a fixed point float.
- These are the only allowed 64 bit types used in runtime structures, as data members and in code.
- These are the only allowed 128 bit types used in runtime structures, as data members and in code.
- 128bit values can be used on any cpu that supports sse
- These are the only allowed types used in load time structures, as data members and in code.
CWEntity* pEntity;
Right:
pEntity = NULL;
Wrong:
pEntity = 0;
bool isValid;
Right:
isValid = true;
Wrong:
isValid = 1;
Right:
bool isValid;
Wrong:
BOOL isValid;
Right:
if (bCondition)
Wrong:
if (bCondition == true)
Right:
bool bTest; ... bTest = GetStatus();
Wrong:
bool bTest = true; ... bTest = GetStatus();
Right:
char variableName; signed char variableName; unsigned char variableName;
Wrong:
UCHAR variableName;
Right:
short variableName; unsigned short variableName;
Wrong:
SHORT variableName; USHORT variableName; WORD variableName;
Right:
int variableName; unsigned int variableName; float variableName; pfloat32 variableName;
Wrong:
long variableName; unsigned long variableName; DWORD variableName; ULONG variableName; UINT variableName; INT variableName; FLOAT variableName; BOOL variableName;
Right:
double variableName; sint64 variableName; uint64 variableName;
Wrong:
long long variableName; unsigned long long variableName; LONGLONG variableName; LDOUBLE variableName;
Right:
sint128 variableName; uint128 variableName;
Wrong:
__m128 variableName;
Right:
char variableName; unsigned char variableName; short variableName; unsigned short variableName; int variableName; unsigned int variableName; float variableName;
Wrong:
signed char variableName; pfloat32 variableName; double variableName; sint64 variableName; uint64 variableName; sint128 variableName; uint128 variableName;
Names:
-
Back to Top
- Use lowerCamelCase for variables and data members.
- Use CamelCase for a class, struct, protocol, function, method or namespace names.
- Fully capitalize acronyms.
- Do not use underscores unless specified by another guideline
- Engine classes should be preceded by CW, classes outside of the engine are preceded with C
- Engine structs should be preceded by SW, structs outside of the engine are preceded with S
- Prefix class and struct data members with "m_".
- Precede boolean values with words like "is", "has" and "did".
- Use full words, for all variables except in the rare cases where an abbreviation would be more canonical and easier to understand.
- Avoid using cross meaning iterator variable names in loops, for example do not use i,j or k as iterator variables when working on a Quaternion or x,y and z when working with a vector as these types can contain data members of the same names causing confusion.
- Use descriptive verbs in function names.
- Leave meaningless variable names out of function declarations.
- Comment unused variable names out of function definitions.
- Use bare words for accessors and should match the name of the variable being accessed.
- Precede mutators with the word "set" and should match the name of the variable being accessed.
- Engine Enums should be preceded by EW, enums outside of the engine are preceded with E
- Enum members should use all uppercase names with words separated by underscores.
- #defined constants should use all uppercase names with words separated by underscores.
- Macros that expand to function calls or other non-constant computation. These should be named like functions, and should have parentheses at the end, even if they take no arguments (with the exception of some special macros like STD_ASSERT). Note that usually it is preferable to use an inline function in such cases instead of a macro.
- #ifndef, #define "header guards" should be named as _INCLUDED_ then followed by text matching the file name exactly, replacing the '.' with a '_' and capitalizing the text.
- The #endif for the header guard at the end of the header file should have a double slash comment appended after it showing the macro name
- The line above the header guard endif should be the standard seperator comment.
- This closing comment should have a space before and after the comment double slash.
Right:
class CDocument; struct Data; size_t bufferSize; char characterDelimiter;
Wrong:
class documentation; class document; struct data; size_t buffer_size; char Characterdelimiter;
Right:
class CWDocumentation; class CDocument;
Wrong:
class documentation; class document;
Right:
struct SWTextureheader; struct STexture;
Wrong:
struct textureHeader; struct texture;
Right:
class CWString { ... short m_length; };
Wrong:
class CWString { ... short length; };
Right:
bool isValid; bool didSendData; bool hasChildren;
Wrong:
bool valid; bool sentData; bool children;
Right:
size_t charSize; size_t length; short tabIndex;
Wrong:
size_t characterSize; size_t len; short tabulationIndex;
Right:
bool convertToASCII(short*, size_t);
Wrong:
bool toASCII(short*, size_t);
Right:
void SetCount(size_t);
Wrong:
void SetCount(size_t count);
Right:
void CWHeap::Free(void* /*pAddr*/) { }
Wrong:
void CWHeap::Free(void* pAddr) { }
Right:
size_t Count();
Wrong:
size_t GetCount();
Right:
void SetCount(size_t);
Wrong:
void count(size_t);
Right:
enum EWMatrixMode { MM_NONE, LOCAL_WORLD, CAMERA_VIEW };
Wrong:
enum matrixMode { None, LocalWorld, Camera_View };
Right:
#define KEY_ALT_MASK 0x04
Wrong:
#define KeyAltMask 0x04
Right:
#define WBStopButtonTitle() NSLocalizedString(@"Stop", @"Stop button title")
Wrong:
#define WB_STOP_BUTTON_TITLE NSLocalizedString(@"Stop", @"Stop button title") #define WBStopButtontitle NSLocalizedString(@"Stop", @"Stop button title")
Right:
#ifndef _INCLUDED_MDXTEXTURE_H #define _INCLUDED_MDXTEXTURE_H
Wrong:
#ifndef _MDXTexture_H_ #define _MDXTexture_H_
Right:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #endif // _INCLUDED_MDXTEXTURE_H
Wrong:
#endif
Other Punctuation:
-
Back to Top
- Constructors for classes should initialize all of their members using C++ initializer syntax.
- All superclasses should be on the same line as the class name
- If there are superclasses (parent classes) Starting on the next line after the class name and superclass list each member with its initialization wrapping at less than or equel to 120 characters further members should be initialized starting with an indent one level past the class name.
- If there are no superclasses (parent classes) Starting on the same line as the class name each member should be initialized wrapping at less than or equel to 120 characters then further lines of members are indented one level past the class name.
- If there are are so few members and superclasses that the initialization fits under 120 characters Starting on the same line as the class name each member should be initialized.
- There should be more than one member on each line making it as compact as is readable without exceeding 120 characters per line including indentation
- The initializer list should match the order of class data members precisely
- Pointer and reference types are compound types and should be written with no space between the type name and the * or & followed by spaces and or indents then the variable name.
- Prefer const to #define.
- Prefer inline functions to macros.
- Inline functions should be explicitly marked as inline with the inline keyword.
- Inline functions consisting of one call or operation should occupy no more than 1 line of code and coexist inside the class definition.
- Inline functions that consist of more than one call or operation should be prototyped (declared) in the class definition and implementated (defined) in the same header after the class defenition.
- Both the prototype (declaration) and the implementation (definition) of inline functions should have the inline keyword as some compilers use one or the other or both to determine inlining rules.
- Implementing intentional infinite loops should be done with a for(;;).
- Enumerations should always be named so they can be used as type safe parameters.
- If the object you are calling a function on, is not going to be modified durring the functions scope, the function should ALWAYS have the const modifier on the end.
- When passing pointers or references to items as function paramaters, and the item being passed should not change, you should mark the parameter as const.
- There is some times confusion on where the const modifier goes when passing parameters, if you dont want the parameter being pointed/referenced to be modifiable do this.
- If however you do not care if the object being pointed to is modifiable, but want to verify the pointer itself never changes, you do the opposite.
- Structs cannot have any member functions they are reserved for data members only.
Right:
Documentation::Documentation(Document* pDoc) : XMLReader(), XMLWriter(), m_memberAlpha(0), m_memberBeta(0), m_memberGamma(0), m_memberDelta(0), m_memberEpsilon(0), m_memberZeta(0), { }; XMLReader::XMLReader() : m_memberAlpha(0), m_memberBeta(0), m_memberGamma(0), m_memberDelta(0), m_memberEpsilon(0), m_memberZeta(0), { }; XMLWriter::XMLWriter() : FileIO(), m_memberAlpha(0) { };
Wrong:
Documentation::Documentation(Document* pDoc) : XMLReader(), XMLWriter() { m_memberAlpha = 0; m_memberBeta = 0; m_memberGamma = 0; m_memberDelta = 0; m_memberEpsilon = 0; m_memberZeta = 0; }
Right:
Image* TextureHandler::DoSomething(Color& tint) { Color* pElement = static_cast<Color*>(node()); const ColorArray& colors = ColorInputs();
Wrong:
Image *TextureHandler::DoSomething(Color &tint) { Color *element = static_cast<Color *>(node()); const ColorArray &colors = ColorInputs();
Right:
inline Color* GetColor() { return m_pColor; }
Wrong:
Color* GetColor() { return m_color; }
Right:
inline Color* GetColor() { return m_pColor; }
Wrong:
inline Color* GetColor() { return m_color; }
Right:
for (;;) { ... }
Wrong:
while (true) { ... } while (1) { ... }
Right:
enum EWTypes { ... }
Wrong:
enum { ... }
Right:
unsigned int GetSize() const { return m_size; } unsigned int SetSize(unsigned int size) { m_size = size; }
Wrong:
unsigned int GetSize() { return m_size; } unsigned SetSize(unsigned int size) const { m_size = size; }
Right:
void Print(const char* pString); // pString is not modified void ModifyString(char* pString); // pString may be modified void ScanObject(const CObject& obj); // obj is not modified void ModifyObject(CObject& obj); // obj may be modified
Wrong:
void Print(char* pString); void ModifyString(const char* pString); void ScanObject(CObject& obj) void ModifyObject(const CObject& obj);
Right:
const CObject* pObj
Wrong:
CObject* const pObj
Right:
CObject* const pObj
Wrong:
const CObject* pObj
Right:
struct SWEntityData { unsigned int m_id; ///< Comment unsigned int m_info; ///< Comment }
Wrong:
struct SWEntityData { unsigned int m_id; ///< Comment unsigned int m_info; ///< Comment /// Get ID unsigned int GetID() { return m_id; } /// Set ID void SetID(unsigned int id) { m_id = id; } }
Include Statements
-
Back to Top
- All cpp files must #include "mstdinc.h" first before all other headers.
- All cpp files must #include their primary header second, just after "mstdinc.h".
- All subsequent #include statements should be in sorted alphanumeric logical order
Right:
#include "mstdinc.h" #include "thisimplementation.h" #include "alpha.h" #include "beta.h"
Wrong:
#include "thisimplementation.h" #include "alpha.h" #include "mstdinc.h" #include "beta.h"
Asserts and Logging
-
Back to Top
- Use STD_ASSERT macro to assert on all platforms.
- Use STD_LOG to write to the log file.
- Use STD_VERBOSE for SPAMMY console output.
- Use STD_TRACE for non-spammy INFORMATION output.
- Use STD_WARNING for NON-CRITICAL ERRORS.
- Use STD_ERROR for CRITICAL ERRORS.
- You must include your own newlines ('\n') in all logging and console output commands.
Right:
STD_ASSERT(pEntity);
Wrong:
assert(pEntity);
Right:
for (;;) { STD_VERBOSE("Spam I am\n"); }
Wrong:
for (;;) { STD_TRACE("Spam I am"); }
Right:
STD_LOG("Complete line of output\n");
Wrong:
STD_LOG("Complete line of output");
Memory Management
-
Back to Top
- Avoid excessive temporary heap allocations. Utilize stack memory and heap pools.
- When using the array delete operator place a space between the delete keyword and the square brackets.
- When in platform independant code (code common to all platforms) use WMemSet(), WMemCopy(), WMemMove() functions in place of platform versions.
- In platform Dependant code (code specific to one platforms) use memset, memcopy, memmove functions designed for that specific platform.
- Make sure your new and delete operator types match up, if you new as an array delete as an array.
Right:
char sName[32]; for (;;) { GetName(sName); UseName(sName); }
Wrong:
for (;;) { char *sName; sName = new char[32]; GetName(sName); UseName(sName); delete [] sName; }
Right:
delete [] pData;
Wrong:
delete[] pData;
Right:
/// Common code across all platforms WMemSet(pAddress, 0, sizeof(object));
Wrong:
/// Common code across all platforms xmemset(pAddress, 0, sizeof(object));
Right:
/// DirectX Win32 memset(pAddress, 0, sizeof(object));
Wrong:
/// DirectX Win32 WMemSet(pAddress, 0, sizeof(object));
Right:
m_pCurves = new CWAnimCurve[m_nCurves]; ... delete [] m_pCurves; ... m_pCurve = new CWAnimCurve(); ... delete m_pCurve;
Wrong:
m_pCurves = new CWAnimCurve[m_nCurves]; ... delete m_pCurves; ... m_pCurve = new CWAnimCurve(); ... delete [] m_pCurve;
Patch Creation - Tortoise
-
Back to Top
- Using Tortoise to create a patch
The correct way :
Wrong:
// ma codes here codes codes
Patch submission - Via the forums
-
Back to Top
- Submitting your patch via the forums
The correct way :
Patch Title: What bug does this patch fix: Detailed Explanation: How to reproduce: Link to thread in bug reports section if available: Patch: Wrap your patch in [code][/code] tags. As well, please upload the .patch file
Wrong:
Hunter pet level patch! //Pet.cpp CODE // Hunter pet should be max 5 levels below owner uint32 level = owner->GetUInt32Value( UNIT_FIELD_LEVEL ); if( type & 0x2 && created_from_creature != NULL ) level = created_from_creature->getLevel() < ( level - 5 ) ? level - 5 : created_from_creature->getLevel();
Comments
-
Back to Top
- The standard seperator is 120 slash characters.
- Functions should be separated by TWO empty lines.
Right:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Wrong:
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\// //---------------------------- //***********************************************************
Right:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool ReturnTrue() { return true; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Next function description
Wrong:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool ReturnTrue() { return true; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Next function description
Doxygen
-
Back to Top
- All source files will have a doxygen header.
- For header files, this should immediately follow the HEADER GUARD.
Sample Header - For source files, this should be at the top of the file.
Sample Source File - The comments for function declarations should be brief and only use one line, use three slashes and a space, and come one line before the function declaration.
- The function definition/implementation should have a more detailed description and should be formatted in doxygen triple slash C++ special block style
- Functions should be commented above their definition/implementation and not below it.
- There are no newlines between a functions documentation block and the function itself.
- A function comment block consists of a leading and trailing seperator line.
- Lines between the seperators are commented with a triple slashe per line.
- Function comment blocks begin with a semi brief sometimes multiple line description.
- All parameters to the function must be commented with a \param section.
- Return values must be commented with a \return section.
- Do not add a return section if it will be void.
- If a function would benefit from it point to other functions or classes with a \sa which means see also.
- Any unfinished functionality should be docmented with a \todo section.
- Any very detailed information or things other programmers should know when using this code should go in a \note section.
- Do not add any section if it will be empty.
- The comment blocks for class declarations should be detailed, use three slashes and a space, and come one line before the class declaration.
- The first line of the comment block should be a \class section.
- The next line of the comment block should be a \brief section followed by an empty line with just a triple slash.
- This is followed by a detailed description of the class and if required a \note block to cover any thing code maintainers may need to know.
- You cannot place a comment at the end of a line.
- Class member variable descriptions should be on the same line as the variable after the semi colon and be formatted as a triple slash followed by less than symbol and a space before the comment.
Right:
#ifndef _INCLUDED_SOURCE_H #define _INCLUDED_SOURCE_H /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Barking Lizards Technologies LLC, 2008, 2009 // All rights reserved. // // Filename: source.h // // Description: Overview of the code included in this file // // Original Author: Firstname 'Nickname or username' Lastname // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Wrong:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Overview of the code included in this file /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef _INCLUDED_SOURCE_H #define _INCLUDED_SOURCE_H
Right:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Copyright Barking Lizards Technologies LLC, 2008, 2009 // All rights reserved. // // Module Name: source.cpp // // Description: Overview of the code included in this file. // // Original Author: Firstname 'Nickname or username' Lastname // ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Wrong:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Overview of the code included in this file ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Right:
/// Create entity and add it to the world static EWResult Add( const char* pEntFile, const char* pEntName=0, const char* pSpawnPoint=0 );
Wrong:
//Create entity from .ENT file specified and then add it to the world. If pEntName!=0, //use that as the entity's unique name. If pSpawnPoint!=0, position the entity there. static EWResult Add( const char* pEntFile, const char* pEntName=0, const char* pSpawnPoint=0 );
Right:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool ReturnTrue() { return true; }
Wrong:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // bool ReturnTrue() { return true; }
Right:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Create entity from .ENT file specified and then add it to the world. /// /// \param pEntFile -- ENT Filename /// \param pEntName -- (optional) Unique name for entity instance /// \param pSpawnPoint -- (optional) Entity name to use as spawnpoint /// /// \return RES_FILE_NOT_FOUND if ENT file missing. RES_FAILURE if CreateEntity fails, otherwise RES_SUCCESS /// /// \note If pEntName != 0, use that as the entity's unique name. /// If pSpawnPoint != 0, position the entity there. /// /// \sa CWEntity::Remove() /// \sa CWEntity::Delete() /// /// \todo Add more error codes for return values /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// EWResult CWEntity::Add(const char* pEntFile, const char* pEntName, const char* pSpawnPoint)
Wrong:
// Create entity from .ENT file specified and then add it to the world. EWResult CWEntity::Add(const char* pEntFile, const char* pEntName, const char* pSpawnPoint)
Right:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// \class CWTimeManager /// \brief Provides an interface to timing related functions. /// /// Provides an interface to timing related functions that are used to uniformly control the /// progression of time throughout the engine. Custom timers can be created or the built in timers that optionally /// reflect pause state can be used. Custom timers support optional pause state and multiplier. /// Built in timers are automatically updated by the engine and should not have settings modified. /// /// \note This is the base class platform dependant classes derive from this /// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// class CWTimeManager
Wrong:
// CWTimeManager Provides an interface to timing related functions. class CWTimeManager
Right:
/// Increment our counter ++j;
Wrong:
++j; /// Increment our counter
Right:
CWEntitySet m_entities; ///< Main entity list
Wrong:
//Main entity list CWEntitySet m_entities;
Subversion
-
Back to Top
- All subversion commits should have clear descriptions of what changed and why.
- Take advantage of atomic commits. Commit all files that have inter-dependent changes at once.
- When commenting a commit of multiple files, list each file or group of files and the changes made to each.
Right:
ADDED : new base class function EndBracket() CHANGED : layout of base class declarations ADDED : DirectX implementation of EndBracket() REMOVED : Old DirectX implementation of End() UPDATED : commented depreciated unused members FIXED : Bug in rotation of matricies
Wrong:
I changed some stuff
Right:
mwgraphicscore.cpp/h: ADDED : new base class function StartBrackets() mwdxgraphicscore.cpp/h: ADDED : DirectX implementation of StartBrackets()
Wrong:
I changed some stuff, and added a few things
Projects
-
Back to Top
- Sample Visual Studio 2008 project file
- General
- C++ General
- C++ Optimization
- The following standard preprocessor defines should take place before any game/whiptail side defines
- C++ Preprocessor
- C++ Code Generation
- C++ Language
- C++ Precompiled Headers
- C++ Output Files
- C++ Advanced
Debug:
Release:
Debug:
Release:
Debug:
Release:
Debug:
WIN32 _WIN32 WINDOWS _WINDOWS DEBUG _DEBUG
Release:
WIN32 _WIN32 WINDOWS _WINDOWS NDEBUG _NDEBUG