Every Number Is Special In Its Own Special Way

I got a question recently about where in the .NET framework the “special numbers” were defined. The questioner was actually asking about the Double.NaN, Double.PositiveInfinity, etc, special values for floating point numbers. Of course there are other “special numbers” defined by the framework, such as Math.PI. The question was easily answered but it got me…

29

A Face Made For Email, Part Three

Yes, it has happened again. This time, our fabulous C# Community Program Manager Charlie Calvert was good enough to put together a little half-hour-long video of me talking about the scenarios which justify changes to the type inference algorithm for C# 3.0. We’ve already made some interesting changes which will make it into the beta…

14

How do I mitigate a SQL injection vuln?

Joel points out today that SQL injection vulnerabilities are common and bad, bad, bad. He does a good job of describing the attack but doesn’t really talk about how to mitigate it. When I advise people on how to close security holes like this I always tell them that closing the original hole is probably…

22

"Boolean or" or "boolean or"?

I was writing the text for some new error messages for the expression tree library the other day. When I ran them past our user education specialists (that is, the people who will be writing the documentation to explain the error messages), one of them pointed out that “Boolean” is an eponym — a word named…

20

Do Not Call IsBadFooPtr, Indeed

Here’s a story that I said a long time ago that I was going to tell you all, and then promptly forgot about it. Raymond Chen’s blog entry today reminded me of it, because this is the story of how I found out the hard way that IsBadFooPtr is bad, bad, bad. Those of you…

11

Why does a recursive lambda cause a definite assignment error?

Hey fabulous readers, sorry for not much blogging lately. Between implementing LINQ and making plans to attend my first Burning Man, there’s been no time for anything. We’ve had lots of new ideas generated here for the type inferencing algorithm which I will discuss in detail when I get back. For now, here’s a question…

7

Type inference woes, part four

Last time in this series I discussed how we are probably going to identify a “best” type from a set of expressions. Clearly we need to solve this problem for features such as implicitly typed arrays. We are also considering extending this algorithm to affect type inference of generic methods. As always, the reason we’re…

8

Error messages: diagnostic is preferable to prescriptive

The new LINQ features are going to create new failure modes for the compiler, so we’re going to need to create some new error messages. The compiler development team got together the other day to discuss what makes an error message good or bad. I thought I’d share with you guys what we came up…

35

What Are The Semantics Of Multiple Implicitly Typed Declarations? Part Two

Many thanks for all your input in my informal poll yesterday. The results were similar to other “straw polls” we’ve done over the last couple of months. In this particular poll the results were: var a=A, b=B; where the expressions are of different types should: have the same semantics as var a=A; var b=B;: 12…

26

What Are The Semantics Of Multiple Implicitly Typed Declarations? Part One

In my earlier series on inferring a unique “best” type from a set of expressions I mentioned that one potential application of such an algorithm is in implicitly typed variables. This led to some good questions and concerns posted in the comments – questions and concerns which echo similar feedback we’ve been receiving from a…

21