David Kean's new blog

For those that are interested, I’ve just started a new personal blog, Dave’s Box, where I will be talking about FxCop, Framework Design Guidelines, and the recently announced Managed Extensibility Framework. I’ve just posted a couple of posts detailing changes we made to FxCop 1.36:  FxCop now ships with the spell checker librariesReference resolution changes in Code…

1

What do you want to see in the second edition of Framework Design Guidelines?

Krzysztof and Brad have announced they are working on the second edition of the awesome Framework Design Guidelines and are looking for feedback on what they should put in it. For those that don’t know, a lot of our Code Analysis rules are based on the writings in this great book, so expect to see…

9

Krzysztof Cwalina on Framework Design Guidelines and API Design

A lecture on API design by Krzysztof Cwalina (the brains behind the Framewok Design Guidelines) has been posted on the Research Channel. This class presents best practices for designing frameworks that are reusable object-oriented libraries. The guidelines are applicable to frameworks ranging in size and in their scale of reuse from large system frameworks to small…

0

How to Design Exception Hierarchies

Krzysztof Cwalina, owner of the Framework Design Guidelines, has written a great post on designing exception hierarchies. He gives a great overview on the different categories of exceptions, which are placed under two main buckets he calls usage and system, and the right situations to throw them. This post also goes hand-in-hand with some of the…

0

FAQ: Why does DoNotExposeGenericLists recommend that I expose Collection<T> instead of List<T>? [David Kean]

DoNotExposeGenericLists fires when I publicly expose List<T> via a field, method, property, or parameter. Why? Although Krzysztof briefly touched on this last year, we wanted to expand on this a little through the use of examples. The first reason is that List<T> is designed for speed and for use as an internal implementation detail, whereas Collection<T>…

3

Seen any Microsoft produced code that doesn't pass Code Analysis/FxCop? [David Kean]

As some of you may already know, the majority of the Developer Division is currently planning features to be included in the next version of Visual Studio (Orcas). As part of this planning phase, the Managed Code Analysis (FxCop) team is beginning to work with other teams around Microsoft to ensure that any customer facing…

16

FAQ: Why do some sources recommend extending ApplicationException while FxCop does not? [Michael Fanning, David Kean]

TypesShouldNotExtendCertainBaseTypes fires on types that derive from ApplicationException and DoNotRaiseReservedExceptionTypes on members that throw ApplicationException. Why? There are several outdated documents floating around on the web (some orginally published by Microsoft) recommending that application developers extend ApplicationException. However, this guidance was revised several years ago for a couple of reasons: It deepens the class hierarchy and…

7