The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Aug 3, 2006
Post comments count 0
Post likes count 0

News Flash: Big houses also cost more to cool

Raymond Chen

Perhaps as a counterpart to the fact that big houses have bigger heating bills, NPR yesterday pointed out that bigger houses use more electricity for cooling. (NPR looks not at the "surprise" of big-house owners over the cost of energy, but rather the consequences of these big houses on the energy grid. But the headline was hard to pass up.)

Aug 3, 2006
Post comments count 0
Post likes count 0

The implementation of anonymous methods in C# and its consequences (part 2)

Raymond Chen

When the anonymous class becomes visible.

Aug 2, 2006
Post comments count 0
Post likes count 0

The implementation of anonymous methods in C# and its consequences (part 1)

Raymond Chen

First we'll look at how they're implemented.

Aug 1, 2006
Post comments count 0
Post likes count 0

C# nested classes are like C++ nested classes, not Java inner classes

Raymond Chen

When you declare a class inside another class, the inner class still acts like a regular class. The nesting controls access and visibility, but not behavior. In other words, all the rules you learned about regular classes also apply to nested classes. The keyword in an instance methods of a class (nested or not) can be used to access members of that class and only those members. It cannot be used to access members of other classes, at least not directly. (And the can be omitted when it would not result in ambiguity.) You create an instance of a class (nested or not) by saying where are the parameters to an...

Jul 31, 2006
Post comments count 0
Post likes count 0

Christmas gift idea for your favorite glasses-wearing geek

Raymond Chen

Yes, I'm talking about Christmas gifts (or "winter solstice gifts" if you prefer) in July. I'm one of those people for whom buying Christmas gifts is a brain-wracking ordeal, and I'm always on the lookout all year round for the "perfect gift". Last Christmas, a friend of mine gave me a micro-fiber lens-cleaning cloth that comes in a pouch you can attach to a keychain. Example 1. Example 2. (I have no affiliation with those two sites; I just hunted around looking for a picture.) Best gift ever. I use it several times a day. My keychain has only four things on it: The aforementioned cleaning cloth, a ...

Jul 31, 2006
Post comments count 0
Post likes count 0

Just because I don't write about .NET doesn't mean that I don't like it

Raymond Chen

Some people have inferred that I don't write about .NET because I don't like it. That's not true. I use it myself. The reason I don't write about .NET is because I'm not an expert on it and there are plenty of other .NET blogs out there, written by people who are actual experts. (Such as Maoni Stephens, whose little finger contains more knowledge about garbage collection than most people have in their entire brain.) No point adding to it with my non-expert view. Indeed, when I hit upon an interesting .NET topic or puzzle, I usually just forward it off to Brad for him to put on his blog. Because people looking ...

Jul 28, 2006
Post comments count 0
Post likes count 0

The Seattle Monorail has two trains, and they collided

Raymond Chen

Murphy's Law vindicated again. The Seattle Monorail has two trains, and last year they managed to collide. To get this to happen was particularly tricky, since the trains run on separate tracks, and there is only one spot on the entire line where a collision could occur—and they found it. You can read about it in this Associated Press article that describes the monorail as a "mile-high, 43-year-old elevated line". Wow, a mile high. Those must've been really long ladders to get people down. It was supposed to resume operation a few weeks ago, but the reopening was delayed due to a glitch in the emergency...

Jul 28, 2006
Post comments count 0
Post likes count 1

The efficiency of ordinal-based imports while still being name-based

Raymond Chen

Reader Tom brought up the interesting point that ordinal-based imports are slightly faster than name-based, though not by much. But if even that tiny fraction of a percentage bothers you, you can still get the benefits of ordinal-based imports while still being name-based. People are more familiar with the first half of the "rebase and bind" duo than the second. But it's binding that speeds up import table resolution. When a DLL is "bound" to another DLL, information about the target DLL is cached in the original DLL. Specifically, the timestamp of the target (so that the loader can detect whether the cache is ...

Jul 27, 2006
Post comments count 0
Post likes count 0

Handy tip: If you're going to break into vehicles, the police vehicle service center is probably a bad place

Raymond Chen

And you probably shouldn't fall asleep in the van you break into.