Coding Specifications in C Sharp

De BISAWiki

Edição feita às 11h45min de 11 de maio de 2014 por PhiljgdpclihlzJosilowsky (disc | contribs)
(dif) ← Versão anterior | ver versão atual (dif) | Versão posterior → (dif)

At 1 time I carried out FxCop frequently to maintain me in line and guarantee my projects fulfill C# coding requirements. Alas, I drifted from FxCop within the very last yr or two (I imagine on account of laziness on my part). During that time, I have adopted a amount of coding standards all my personal (several of which I'm not as well happy with).

Recently, a colleague reintroduced me to FxCop (now called Code Investigation) and launched me to StyleCop - and in among the two of these tools I could not be a lot more pleased. With these 2 whipping me in line I can in fact say that my code looks equivalent to the code from the remainder of my team and vice versa. The purpose is usually to have coding expectations adhered to, but imposing these requirements is hard to do with a Word file. Every single group I've been on has a file for C# coding needs, but if there is no strategy to assimilate that document with VS.Internet or if the group does not consider on typical code critiques you are heading to have a very difficult time imposing these standards. Possessing the correct instruments integrated into Visible Studio.Web to often remind programmers whether their C# is conference Microsoft's rules is huge from not just a "we are a steady team" standpoint, but for self-gratification as effectively. Similar to executing unit tests and obtaining all inexperienced check out marks, there is gratification in operating FxCop and StyleCop and viewing them both appear back with (zero) alerts.

c code

For leisure, I advise deciding on a single of your present tasks and working the two equipment. Go more than each and every of the alerts (regardless how minor they appear) and make the important modifications. When you're completed, overview your perform and question by yourself if you really feel better about what you've modified. For me individually, incorporating XML commenting to each technique and residence just how StyleCop enforces appeared fairly unneeded, but it experienced a main influence on the readability of my code foundation for other crew members. The hardest part about adoption of the tools is receiving your coworkers to recognize the motives for sticking to the procedure. In the long run, they will be a lot more content when everybody has has employed enforceable expectations.

Mastering C# is not just about finding out Object-Oriented ideas and syntax - it really is also about expectations and becoming a valued crew member. A large-amount of C# coding anticipations will deliver you a lot of actions nearer to your staff when developing exceptional software program. In amongst C# coding recommendations and top quality control with unit tests your group will have tidy, dependable code that they'll count on for the foreseeable future.

FxCop is developed-into Visible Studio.Net 2010 today referred to as Code Evaluation. Simply be certain to activate code analysis in the task properties window of your projects. StyleCop is found at http://stylecop.codeplex.com/ and it is certainly really worth the value (totally free).

Ferramentas pessoais