New and better tools are usually a good thing. So it is when moving from Visual Studio 2003 to the 2005 edition. Advantages of moving C++ development to Visual Studio 2005, Team Edition Developer include…
- Global/shared property sheets allow developers to change a setting in one place and have it apply to all projects. This makes it vastly easier to add new include paths and libraries, etc.
- New /analyze static analysis option goes the extra mile in identifying bugs such as buffer overflow, memory leaks, failure to check return types, etc. This feature is only available in VS 2005 Team Edition Developer.
- Better debugger supports tracepoints and displays STL containers in a human-readable format! See http://blogs.msdn.com/andypennell/archive/2004/06/29/169002.aspx for more information.
- Improved remote debugging.
- More standards-compliant C++ compiler. See http://msdn2.microsoft.com/en-us/library/ms177253(vs.80).aspx
- Built-in profiler.
- Const-correctness checks in functions such as strchr, strstr, etc. help identify and prevent bugs.
- Organize sub-projects into solution folders.
- Can substitute more secure versions of strcpy, strcat, etc. automatically under certain conditions if we define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES. There’s also _CRT_SECURE_NO_DEPRECATE.
- More and better warnings.
- Dependency checking is faster. This means, for example, that cleaning a solution is much faster than with VS 2003.
- Stack smashing protection (the /GS flag) is more robust.
- printf family of functions support the C99 Standard of “%ll” and “%ull” for 64 bit integers in addition to the non-portable, Microsoft-only VS2003 “%I64d” syntax.
Costs of migrating to VS 2005:
- Compiled code size is slightly larger.
- The IDE requires more memory to run.
- Third party libraries and libc
- Template code may need to be modified.
Additional resources:
Migration Strategy
It’s usually not a good idea to migrate a code base immediately, although it could be good way to anger management. Here’s what I recommend:
- Copy your top-level solution mysolution.sln to mysolution.vs2005.sln.
- Copy all sub-projects *.vcproj to *.vs2005.vcproj.
- Edit mysolution.vs2005.sln and chang all .vcproj references to .vs2005.vcproj.
- Open mysolution.vs2005.sln in VS 2005. It will migrate the project automatically.
- Add the new solution and project files to your source control system (Subversion, Perforce, CVS). This way, you won’t affect the day-to-day development operations of the rest of your team. You could write a script to automate the above steps so that it is easier to keep in-sync with the additions, renames and removals of includes, source, and so on from the VS 2003 solution.
- Compile and fix errors gradually.
- You may need a new version of Microsoft’s WTL, which is backwards compatible with VS 2003.
- You may need to fix template syntax issues.
- Fix const-correctness issues.
Eventually your team will become comfortable with VS 2005, and you can switch.