Scott Dorman

ephemeral segment

  Home  |   Contact  |   Syndication    |   Login
  603 Posts | 10 Stories | 862 Comments | 51 Trackbacks

News


Post Categories

Image Galleries


Microsoft Store


Creative Commons License



Locations of visitors to this page

Subscribers to this feed

TwitterCounter for @sdorman

View blog authority

Add to Technorati Favorites

Windows Live Alerts

AddThis Social Bookmark Button

LinkedIn profile

Community Credit profile

The Code Project

Follow me on Twitter

Get Free Shots from Snap.com

Community Credit Hall of Fame

Get Feedghost

Xobni outlook add-in for your inbox



Support This Site

Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

Jason Allor, the developer behind the Microsoft StyleCop tool has an excellent blog post about the historical evolution of C# code style. The post came about largely in response to some criticisms about the code style enforced by StyleCop and how it doesn’t match C/C++ style or that it differs in some areas with the Framework Design Guidelines.

As Jason points out, most of the differences are historical and are there because the of two reasons:

  1. The original development team for the CLR consisted mainly of C++ developers.
  2. There were no other code standards available since C# was a brand new language, so the team writing the first version of the .NET Framework really only had C++ guidelines to follow.

As more Microsoft development teams began writing C# code the C# style began to evolve. This is the hallmark of any coding style…it isn’t set in stone, but is, instead, a living, breathing, thing. In order for a style to survive time and language changes it must be adapted as the need arises.

This is exactly what has happened to the C# style. Is there a possibility that we end up with competing styles? Absolutely! Does anyone remember the K&R C style vs. BSD KNF? Both of these styles are very much alive in the C/C++ community today and there are no signs of either of these going away any time soon.

With tools like StyleCop and FxCop, hopefully we won’t end up with multiple competing standards. As a community we should decide on a core set of guidelines and enforce them whenever possible.

posted on Sunday, July 20, 2008 1:32 PM