Click here to Skip to main content
13,559,848 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello all,

I have been reading information and the usage of FxCop and StyleCop for a day or so. But I also would like to have your opinions? You useful and important to use these two programs. I will be glas if you can share your thoughts with me.

Posted 24-Jan-12 11:21am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

First, about FxCop. I think it is a very useful if you take is critically. You certainly need to adjust the rule sets and customize some rule to get a reasonable check. In my opinion, some rules cannot be used because they are simply idiotic. I give some example with argument in my past answer:

FXCop - How seriously do you take it?[^].

Please also see the opinion of OP Joe_Dert and Andreas Gieriet — they are interesting and make sense. Basically, we all agree.

Now, StyleCop. This is a very different thing. I see no reason to recommend it. I tested it just once to through out in disgust. It's much worse than FxCop. How about such "improvement": using clauses are re-sorted alphabetically. I tend to sort group them semantically, from lower level to application level. We human being remember things semantically, positionally, etc. For alphabetic search, there is a Search dialog. Many other stupid things. I cannot imaging how can it help and why. However, I can imagine some people who might like it.

Style can only be as good as it supports maintenance of the code.

Well, see by yourself.

wonder-FOOL 25-Jan-12 12:44pm
I have voted 5+ thank you very much for the detailed answer I really appreciate it and respect your solutions. Thanks.
Sergey Alexandrovich Kryukov 25-Jan-12 12:55pm
You are welcome.

Good luck, call again.
Sergey Alexandrovich Kryukov 25-Jan-12 14:33pm
By the way, how about accepting this answer formally (green button) -- thanks.
wonder-FOOL 25-Jan-12 19:41pm
:) I know how to accept the answer. At first I have 5ed you because I thought some other people might answer it but seems like noone did it so i went ahead and marked it as an answer now.
Sergey Alexandrovich Kryukov 25-Jan-12 20:04pm
Great, thanks.

Andreas Gieriet 25-Jan-12 14:57pm
My 5! I fully agree. What concerns FxCop: Use it and use it wisely. I.e. deliberately decide what rules make sense to you. The rest: ignore (turn off). I have no experience with StyleCop. As part of my work, I review a lot of C# code. There are huge differences in coding styles (I.e. how to express the task at hand in a clear and concise way, using the language features in a decent way). I have my doubts if style can be checked by a tool in a useful way - the topic is too much dependent on taste, too: what is "clear", what is "concise", what is "decent"? In the end it's the whole picture that you as a reviewer either understand or that is so confused that you suspect hidden mistakes or errors everywhere... Cheers Andi
Sergey Alexandrovich Kryukov 25-Jan-12 20:04pm
Thank you Andi.
Great points about the taste.

The individual traits are usually highly under-estimated. This is not just about taste which in principle could be wrong, based on misconception (there is a notion of ill taste), but types of memory and cognitive constitutions in different characters have striking differences. Decent styles can be very different but but comparable. At the same time, people understand each other very well if they learn to do so through experience and thinking about it. Lack of flexibility in formal methods can spoil it, compromise performance and drive.

Thank you, Andi,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web03-2016 | 2.8.180527.1 | Last Updated 24 Jan 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100