Coding Expectations in C Sharp
De BISAWiki
(Criou página com 'At one particular time I implemented FxCop often to preserve me in line and assure my projects fulfill C# coding standards. Alas, I drifted from FxCop inside the previous year or...')
Edição posterior →
Edição de 11h55min de 11 de maio de 2014
At one particular time I implemented FxCop often to preserve me in line and assure my projects fulfill C# coding standards. Alas, I drifted from FxCop inside the previous year or two (I feel on account of laziness on my portion). During that time, I have followed a variety of coding expectations all my personal (a lot of of which I'm not too happy with).
Not too long ago, a colleague reintroduced me to FxCop (now known as Code Analysis) and released me to StyleCop - and in in between the two of individuals resources I could not be more satisfied. With individuals 2 whipping me in line I can truly say that my code seems comparable to the code from the remainder of my crew and vice versa. The intention is typically to have coding standards adhered to, but enforcing these specifications is hard to do with a Word file. Each group I've been on has a file for C# coding demands, but if there is no method to assimilate that doc with VS.Net or if the crew does not just take on normal code critiques you are going to have a really difficult time implementing these standards. Having the appropriate equipment integrated into Visual Studio.Internet to always remind programmers whether their C# is meeting Microsoft's guidelines is substantial from not just a "we are a steady team" standpoint, but for self-gratification as well. Comparable to executing unit checks and getting all eco-friendly examine marks, there is gratification in managing FxCop and StyleCop and looking at them equally arrive again with (zero) alerts.
For leisure, I suggest picking 1 of your existing initiatives and working each equipment. Go more than every of the alerts (irrespective how slight they look) and make the essential modifications. When you're accomplished, overview your perform and inquire your self if you truly feel much better about what you've transformed. For me personally, incorporating XML commenting to every single strategy and home just how StyleCop enforces appeared somewhat needless, but it experienced a key affect on the readability of my code foundation for other staff associates. The toughest part about adoption of the instruments is receiving your coworkers to realize the motives for sticking to the approach. In the long run, they will be much more happy when absolutely everyone has has used enforceable expectations.
Mastering C# is not just about understanding Item-Oriented ideas and syntax - it's also about standards and being a valued team member. A substantial-level of C# coding anticipations will bring you many measures closer to your group when developing outstanding software program. In amongst C# coding suggestions and quality management with unit tests your staff will have tidy, reliable code that they'll count on for the foreseeable long term.
FxCop is built-into Visible Studio.Net 2010 presently referred to as Code Analysis. Just be certain to activate code evaluation inside of the task homes window of your assignments. StyleCop is found at http://stylecop.codeplex.com/ and it is certainly value the cost (free of charge).