|
|
All the things below are REALLY important!! Only the editor settings and sentences with "should be" are probably not that important. But please do everything mentioned here. |
|
Copyright (C) 2002 by The Spaceports Team |
|
Version History: (version - date - editor - comment) |
|
|
|
Each source code file (including .h and .cpp files) must contain the following header: /* Copyright (C) 2002 by The Spaceports Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Each .h file must contain a comment block for each class definition, placed just above the class definition. This comment block should describe the functionality of the class. Also the initial author of the class should be mentioned. Example: /** * TestClass * This class is just for demonstrating purposes. It's interacting with * the class AnotherClass and serves as a blah. * Author: John Doe */ class TestClass : public BasicTestClass { ...
Example for commenting functions: /** * An example method * Params: * [IN] index: an index to something * [IN/OUT] tester: pointer to ITest that will be modified in this method * [OUT] inTester: pointer to ITest that will return the original * Returns: * The result. TEST_SUCCESSFUL if successful, TEST_FAIL if not. */ int performTest(int index, ITest* tester, ITest* inTester); |
|
Each line should be not longer than 100 characters. See editor settings A method should fit on one screen page. If the method is getting larger, try to split it up into different methods. For readability try to divide logical blocks within a method. Add a small comment above each block describing very briefly what this block does. Do this as soon as you think that the block and the method are fine and wont be changed much. Commenting blocks shouldn't slow down the coding process, but it should also not be forgotten. Try to find the right time when to comment, and keep in mind, that there is nothing worse than a wrong (or old) comment that describes wrong functionality. |
|
Everytime you commit file changes to the CVS, please add a detailed comment (in the check-in dialog) with all your changes. |
|
Tabs should be converted to spaces standard indent of 2 spaces Maximum line width of 100 characters |