Note To Microsoft About Backgrounds

Microsoft did the right thing and broadcast their E3 announcements today. Good idea!

They broadcast the video of the announcer standing in front of a field of dots. Bad idea…

The video of this was bigger, and the dots were very distracting.

Microsoft’s LINQ and Apple’s Cocoa Key Paths

I’ve been working with Objective-C recently, and ran across a discussion of Cocoa Key Paths and Microsoft’s LINQ. With Microsoft LINQ (Language Integrated Query), you can do things like this:

public void Linq1() {
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };

var lowNums =
from n in numbers
where n < 5
select n;

Console.WriteLine("Numbers < 5:");
foreach (var x in lowNums) {
Console.WriteLine(x);
}
}

Resulting in:

4
1
3
2

That’s pretty cool. More complex examples make a built-in query language pretty handy. You can see more examples on Microsoft’s Linq examples page.

Cocoa has a similar feature, called key-value coding.

You can read more about how Apple’s OS X handles this in Matt Long’s posting over at the interestingly named “Cocoa Is My Girlfriend” blog.