Introduction
If you've done any development in a team environment, I'm sure you are aware of the pains associated with such development.
You spend a whole day debugging and fixing conflicts only to come in the next day and find your code broken again. You decide enough is enough and walk over to your teammate and ask him for an explanation. He shows you that his version compiles and runs just fine. You walk back to your terminal scratching your head thoroughly frustrated and spend the next six hours locating an environment configuration variable that has been breaking your code.
A code base can grow exponentially in a team environment, getting bloated with buggy code, conflicts, configuration issues, environment issues, etc. A huge amount of time is wasted in debugging and resolving environment and configuration issues, increasing your projects time and reducing productive coding.
So what's the solution? While it is a complex problem with a number of parameters that could go wrong and no perfect solution. Implementing an efficient code management process that suits your team's development needs and environment may not be perfect but could still make things a little less frustrating and improve your overall efficiency.
Based on how your team operates, you'll need to find the right balance between a technical or managerial solution. So below is a rough guide on what is available out there and by no means exhaustive.
Tools
Like they say, the right tools get the job done. Here are a few tools that can aid in managing your code.
- Firstly you need some kind of a code repository (I prefer SVN). There are a host of other commercial and open source products to choose from: Visual Studio, Telelogic Synergy, CVS, etc.
- You need a good diff and merge tool that can be used with the code repository (DiffMerge seems like a nice tool to do this, again a whole lot of them are available.
- If your projects uses a database, then you should also get some database diff tools. I use SQLDiff.
- Re-factoring tools will help keep your code in good shape, a nice add on to Visual Studio is ReSharper.
- Logging is a really helpful feature to have in any project. Trying to debug a project for every error that occurs in a team environment can make it extremely frustrating and wasteful activity. Logging can give you the ease of locating the errors at a glance. Log4Net is an open source library that you can use. It allows you to set and change the severity level in your project and allows you to choose a logging medium like a flat file, event logs or a database.
- A continuous build machine can greatly help in team development, users have access to different builds. Each build can be configured to show the diff between a baseline (stable project) making it easy to compare broken versions of the build.
Process
All the tools in the world cannot help without some degree of good process management. Like any other management practice, it requires planning, organizing, training and controlling to improve productivity.
- Come up with a plan on how to structure/organize, share and store your code base. Review this plan periodically and update it to suit your changing needs.
- Things to consider in your plan naming conventions, integration schedules/policies, consideration for environment differences, deployment practices, release management.
- Documentation is key, convert your plan into policies, rules, guides for the team. This will also ensure that information on your process is readily available to the team.
- Train the team, everyone needs to be on the same wavelength in order to be effective, so train everyone on the team.
I've only outlined a few possibilities to better code management in a .NET team environment. Get creative, use your imagination and get everyone involved to come up with the right tools and techniques for your team.