The C# 5.0 beta release is now available

I am super excited to announce that the beta release of Visual Studio version 11 (which includes the .NET CLR version 4.5, Visual Basic version 11 and C# version 5) is available for download right now. As you know if you’ve been following our CTP releases, in C# and VB we’ve greatly improved the ease…

20

The Solution To The Simple Puzzle

The first time I ran my histogram visualizer I asked for a Cauchy distribution with a minimum of -10 and a maximum of 10, and of course I got a graph that looks much like the one from my article of last week:   Looks perfectly reasonable; I guess my program is correct right out…

9

A Simple Puzzle

My original version of the histogram-generating code that I whipped up for the previous episode of FAIC contained a subtle bug. Can you spot it without going back and reading the corrected code? private static int[] CreateHistogram(IEnumerable<double> data, int buckets, double min, double max){  int[] results = new int[buckets];  double multiplier = buckets / (max…

24

Generating Random Non-Uniform Data In C#

When building simulations of real-world phenomena, or when generating test data for algorithms that will be consuming information from the real world, it is often highly desirable to produce pseudo-random data that conform to some nonuniform probability distribution. But perhaps I have already lost some readers who do not remember STATS 101 all those years…

14

Bad Metaphors

The standard way to teach beginner OO programmers about classes is to make a metaphor to the real world. And indeed, I do this all the time in this blog, usually to the animal kingdom. A “class” in real life codifies a commonality amongst a certain set of objects: mammals, for example, have many things…

37

What is "binding" and what makes it late?

“Late binding” is one of those computer-sciency terms that, like “strong typing”, means different things to different people. I thought I might describe what the term means to me. First off, what is “binding”? We can’t understand what it means to bind late if we don’t know what it is to bind at all. A…

14

What’s the difference? Trenchcoat vs Duster

Today, yet another episode in my ongoing series “What’s the difference?” This time, a non-computer-related topic. I am often complimented on my choice of outerwear in the Seattle rainy season, and I hate to respond to a well-meant compliment with a correction. So I usually let all those “Nice trenchcoat!” comments slide and just say…

18