Why are anonymous types generic?

Suppose you use an anonymous type in C#: var x = new { A = “hello”, B = 123.456 }; Ever taken a look at what code is generated for that thing? If you crack open the assembly with ILDASM or some other tool, you’ll see this mess in the top-level type definitions .class ‘<>f__AnonymousType0`2′<‘<A>j__TPar’,'<B>j__TPar’>…


Hiring for Roslyn

A couple years ago I made a blog posting called “The Managed Languages Team Is Hiring” mere hours before our senior management announced that our hiring goals had been met and told me to please stop recruiting people. That was a little embarrassing. This time I have been assured that, really truly, we do have…


All your base do not belong to you

People sometimes ask me why you can’t do this in C#: class GrandBase{  public virtual void M() { Console.WriteLine(“GB”); }} class Base : GrandBase{  public override void M() { Console.WriteLine(“B”); }} class Derived : Base{  public override void M()   {     Console.WriteLine(“D”);    base.base.M(); // illegal!   }} The author of the most-derived class here…


Big head, long tail

Here’s a graph of the population size of the one hundred largest urban areas in Canada: (Click on the graph for a larger version.) Notice how there is an enormous spiky “head” on this graph: Toronto, Montreal and Vancouver are quite large cities by any measure. Then there is an immediate sharp drop to a…