Team Coding - short guide to SVN
Programming projects have become very complicated. Most of the programs that we use have been build by many programmers in a long period of time. It is almost impossible to make a good and useful program all by yourself. So that is why many programmers gather in a team and focus on one project. Here, it is very important that each programmer has all the changes the other ones made.
It is very important in a project that: You are understood by the other programmers and You understand the other programmers. That is why in evey programming language there are Coding Standards (CS). These CS make the source code be easy read and easy modified by any coder in the team. Here are a few CS that should be applicable in most projects:
- one instruction per line
- local variables should only have small letters and “_” should be the word separator
- Global variables should be all CAPITALIZED
- Variables and functions should have names that clearly say what it is/does. Ex: Don’t have variable named “var1″ or functions called “doSomething()”
- Don’t make long and tweaked commands , except it is absolutely necessary, in witch case they should be well documented with //comments
- No bugs in the programming
The Coding Standards are very usefull when working in a team. In a big project there are some problems that need to be very well know. For example what happens in two people work on the same file in the very same time? Each does modifications and after they upload it to the server ONLY ONE will be visible (the other one will be over-written). Also, if someone finds a problem/bug, how does he report it fast to the entire team? Also, it is very important to be a Revision Control. In case a bad change is made to the project, there always is the posibilitty to roll-back to a previous version.
Also, SVN can work on more branches at the same time. There is a main branche (the projects itself) and other auxiliar branches (modules, other features and stuff like that). At the end, all these branches can be merged into one full and working project.
SVN is really easy to work with. All changes are made locally on the work computer and after that the modifications are uploaded onto the server. The users sees these as a clasic directry/file structure (as in Windows Explorer).
Here are a couple of usefull resources:
1. C++ Coding Standard – http://www.possibility.com/Cpp/CppCodingStandard.html
2. Indent – http://www.gnu.org/software/indent/
3. CodeCheck – http://www.abxsoft.com/codchk.htm
4. Subversion - http://subversion.tigris.org/
5. TortoiseSVN - http://tortoisesvn.tigris.org/
6. Trac - http://trac.edgewall.org/
Article inspired by Valentin Stanciu
