Use of Coding Standards

Use of Coding Standards.

If you're working in a team and use Visual Studio for development then here are a few guideline tips on how to improve the pace and maintain the uniformity among all your team champs. Even if you're working alone, it will help you to stay on a track rather moving on a different track as you go further hence allow you to focus on your programming.

Coding Standards

Before beginning any application development, consider implementing programming and database standards with your team. Using development standards allows all programmers to know what is expected of them and how to create new applications from scratch. Standards help developers move from one project to another without having to learn a different style of programming because it was created by another programmer.

Microsoft has published a set of programming standards for C# and Visual Basic. These are an excellent place to start, and you're always encouraged to adopt some sort of standards as an important first step in application development.

Creating standards doesn't limit your creativity, since many programmers seem to think. Programming standards help you focus your creativity where it is really needed. You can concentrate on the business problems you are trying to solve, instead of always having to think about what name to give a method or variable. As a corollary, consider the Windows and Mac operating environments, where most programs are written have a consistent look and feel. This is why users like using Windows or Macs, because they don't need to learn everything about how a new program works. They already know how to use most of the features in each program. Using standards in your programming keeps the programmer's “look and feel” consistent. You spend less time figuring out what the variables are or how many indents a programmer used and focus on the logic of the program.

The use of standards leads to reduced maintenance costs due to consistency in each program. You can move from one project to another very easily, even one someone else wrote, and immediately read and understand the code. Programming standards help programmers create a consistent structure, code style, variable names, and method names within all applications. Standards create code that is unambiguous, easy to read, and easy to maintain by other developers.

The standards documents you should have in place at your shop are:

  1. Visual Studio Setup.
  2. C# or Visual Basic Programming Standards.
  3. SQL Server Object Naming Standards.
  4. Database Development Standards.
  5. Any other framework(s) involved in your project (if any).

The Visual Studio Setup document ensures that each programmer configures his or her Visual Studio the same as everyone else in the shop. Especially important is the Tab setting, that forces everyone to use the same tab indent. Consider what happens if you have your tab stops set at three spaces and you check a file into your source control system. Then your co-worker sets her tab stop at two spaces, checks out your file, reformats the document to two spaces, and checks that version into source control.
If you want to see the changes made by your co-worker, the source control system shows that every line has been changed because reformatting changes every line to use two spaces instead of the three spaces that you'd set.

The C# or Visual Basic Programming Standards document sets forth variable and method naming, class naming, file naming, and control naming. Naming each of these items consistently greatly aids readability among all programmers in your shop.

The SQL Server Object Naming Standards document describes how to name tables, Stored Procedures, views, and other database objects. You should also describe how SQL keywords and functions in your SQL statements are cased.

The Database Development Standards document describes your database design approach. Your approach may include things such as how you create primary keys, the use of clustered indexes, standard fields for each table, how to handle concurrency, and whether or not to use dynamic SQL or Stored Procedures.

Along with the preceding documents, if you've planned to involve any other Framework / Tool in your project, it is advised to have one for that also.

Despite what is mentioned above you're always free to customize the style of standards you're going to create before you start the project.

I hope you enjoyed this article... thank you for reading!!


Recommended Free Ebook
Similar Articles