Krzysztof’s Laws of API Design

I always thought about writing down the laws of APIs design. By “laws”, I mean principles that don’t seem to change based on the particular scenario at hand, whether the API is low of high level, etc. Here is my first try. I would appreciate any comments. Update: “usability” in this context means “how easy to…


I don’t like the “Base” suffix

Today, I was reviewing a set of recommendation for naming types intended to be inherited from. The author suggested using the “Base” suffix for such types. I personally don’t like to do this. Here are the reasons: First, what do you call base of a base class? Or what do you call an abstract subclass…


Channel 9 video showing a real usability study

Channel 9 just posted a video in which our API usability engineers talk about one of the studies they conducted recently, but what’s even more interesting, in part two of the story, they show a clip from an actual study where a participant writes a workflow application. This is big! We have tried to release…


Immutable Collections

I just saw an interesting post that talks about a general pattern of immutable reference types. Good read. I highly recommend it! At the end of the post the author suggests that we add “value object” generic collection to the BCL. It’s an interesting suggestion, but unfortunately not as easy as it may seem. The…


Why Do We Have EventArgs Class?

There is an interesting thread on MSDN newsgroups (see “event arguments” thread) about the design of our eventing APIs. The question is why do we even have EventArgs class (which is empty)? Should we just allow the second parameter to the event handlers to be an arbitrary type? We created EventArgs to make it easier…


Activator.CreateInstance<T> – System.Type vs. Generic Method

Daniel Moth asked, in his post, how to choose between a generic type parameter vs. a formal parameter of typed as System.Type. For example, the following two members seem equivalent. public class Activator {    public static object CreateInstance(Type instanceType);    // or?    public static T CreateInstance<T>(); } The generic method seems slightly better, as it returns…


Fix to TxRef

The Framework Design Guidelines book comes with a tool called TxRef. The tool was built with Beta 2 version of the Framework 2.0 and will not compile on the RTM version. Kathy just posted a fix to the problem. See


FDG book readership beyond our wildest dreams

The Framework Design Guidelines book is being read by readers we never thought would be interested in API design. Richard has captured a photo showing one of the readers being simply glued to the Type Design chapter.


SYS-CON TV Interview

I did an interview for SYS-CON TV. I talked about the Framework Design Guidelines book and other API related things. The interview can be viewed at


Ship Party!

Online publishers have started shipping the Framework Design Guidelines book. Before, it was pre-order-only. I think Brad and I deserve a ship party 🙂 BTW, “ship party” is the term we use at Microsoft for a party we organize for ourselves after releasing a product. I am not sure whether it’s Micro-speak or a broadly…