O'Reilly logo

Professional Visual Studio® 2010 by Chris Anderson, Michael Minutillo, David Gardner, Nick Randolph

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Code Consistency Tools

WHAT'S IN THIS CHAPTER?

  • Working with source control

  • Creating, adding, and updating code in a source repository

  • Defining and enforcing code standards

  • Adding contracts to your code

If you are building a small application by yourself, it's very easy to understand how all the pieces fit together and to make changes to accommodate new or changed requirements. Unfortunately, even on such a small project the code base can easily go from being very well structured and organized to being a mess of variables, methods, and classes. This problem is amplified if the application is large, complex, and has multiple developers working on it concurrently.

In this chapter, you will learn about how you and your team can use features of Visual Studio 2010 to write and maintain consistent code. The first part of this chapter is dedicated to the use of source control to assist you in tracking changes to your code base over time. Use of source control facilitates sharing of code and changes among a team but more importantly gives you a history of changes made to an application over time.

In the remainder of the chapter you will learn about FxCop and StyleCop, which can be used to set up and enforce coding standards. Adhering to a set of standards and guidelines ensures the code you write will be easier to understand, leading to fewer issues and shorter development times. You'll also see how you can use Code Contracts to write higher quality code.

SOURCE CONTROL

Many different ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required