The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Another Seattle bus tool: One Bus Away
Feb 17, 2009
Post comments count 0
Post likes count 0

Another Seattle bus tool: One Bus Away

Raymond Chen
Raymond Chen

I was recently tipped off to yet another Seattle bus tool: One Bus Away, which not only provides real-time bus arrival information for every stop in the Metro system, but does so in a variety of formats. You can use the Web-based interface (which is close to what you can already get from the Tracker Location View), but the real magic is that the information is also available via SMS, Web-enabled handheld devices, and—most important to me—any mobile phone. I have One Bus Away on my speed dial, and I've set bookmarks on the stops I use the most, so I'm never more than a few taps of the phone away fr...

Why doesn’t the file system have a function that tells you the number of files in a directory?
Feb 17, 2009
Post comments count 0
Post likes count 0

Why doesn’t the file system have a function that tells you the number of files in a directory?

Raymond Chen
Raymond Chen

There are any number of bits of information you might want to query from the file system, such as the number of files in a directory or the total size of the files in a directory. Why doesn't the file system keep track of these things? Well, of course, one answer is that it certainly couldn't keep track of every possible fragment of information anybody could possibly want, because that would be an infinite amount of information. But another reason is simply a restatement of the principle we learned last time: Because the file system doesn't keep track of information it doesn't need. The file system doesn't...

Don’t keep track of information you don’t need
Feb 16, 2009
Post comments count 0
Post likes count 0

Don’t keep track of information you don’t need

Raymond Chen
Raymond Chen

This is sort of an extreme corollary to Don't save anything you can recalculate. Sure, it sounds like such an obvious principle, but many people fail to understand its consequences. Let's look at the principle again. Don't keep track of information you don't need. I remember being asked to look at a customer's program, and one thing that struck me was that the program had a bazillion different flag variables that it spent a lot of time setting and clearing. Here's an oversimplified example: void CConfiguration::ShowDialog(HWND hwnd) { m_fShowingDialog = true; DoModal(hwnd); m_fShowingDialog = false; ...

The love bus, also known as Metro Bus Route number 308
Feb 13, 2009
Post comments count 0
Post likes count 0

The love bus, also known as Metro Bus Route number 308

Raymond Chen
Raymond Chen

Four years ago, Troy Kleweno spotted Christine Hsieh on the 308 bus. He saw her twice a day, once in the morning on the way to work, and again in the evening on the way home. His co-workers teased him about the "bus girl" he pined after for six months before he finally said hello. That led to a date, and soon they were a couple. It's only fitting then that when Troy decided that it was time to propose marriage, that he do it on the 308 bus. Watch it here. Happy Valentine's Day, everybody.

The checkbox: The mating call of the loser
Feb 13, 2009
Post comments count 0
Post likes count 0

The checkbox: The mating call of the loser

Raymond Chen
Raymond Chen

(Cultural note: The phrase the mating call of the loser is a term of derision. I used it here to create a more provocative headline even though it's stronger than I really intended, but good writing is bold.) When given a choice between two architectures, some people say that you should give users a checkbox to select which one should be used. That is the ultimate cowardly answer. You can't decide between two fundamentally different approaches, and instead of picking one, you say "Let's do both!", thereby creating triple, perhaps quadruple the work compared to just choosing one or the other. It's like you'...

Superthunderstingcar is go!
Feb 12, 2009
Post comments count 0
Post likes count 0

Superthunderstingcar is go!

Raymond Chen
Raymond Chen

If you are an old geezer, you'll remember supermarionated shows, the most famous of which is Thunderbirds. And if you're not an old geezer, then this amazing spoof by Peter Cook and Dudley Moore will mean nothing to you. (You will also have no idea who Peter Cook and Dudley Moore are.)

What does the COM Surrogate do and why does it always stop working?
Feb 12, 2009
Post comments count 0
Post likes count 4

What does the COM Surrogate do and why does it always stop working?

Raymond Chen
Raymond Chen

The process goes by the name COM Surrogate and the only time you're likely even to notice its existence is when it crashes and you get the message COM Surrogate has stopped working. What is this COM Surrogate and why does it keep crashing? The COM Surrogate is a fancy name for Sacrificial process for a COM object that is run outside of the process that requested it. Explorer uses the COM Surrogate when extracting thumbnails, for example. If you go to a folder with thumbnails enabled, Explorer will fire off a COM Surrogate and use it to compute the thumbnails for the documents in the folder. It does this becaus...

In order to serve you bett… wait, it really is better: Fuel surcharges
Feb 11, 2009
Post comments count 0
Post likes count 0

In order to serve you bett… wait, it really is better: Fuel surcharges

Raymond Chen
Raymond Chen

Normally, the phrase In order to serve you better means that you're about to get screwed. Imagine my surprise to discover that United has stopped imposing a fuel surcharge for flights between Canada and the United States due to the decrease in fuel prices. But wait, that's only for flights between Canada and the United States. Flights within the United States appear to have the surcharge in place as usual. Hey, I've got an idea. How about getting rid of this surcharge nonsense and just raise the price of the ticket? Naw, that's just crazy talk. I can see the Calvin & Hobbes cartoon already. "Lemo...

If you get confused by a register dump, then you’ll just have to accept that some of my postings won’t make any sense
Feb 11, 2009
Post comments count 0
Post likes count 0

If you get confused by a register dump, then you’ll just have to accept that some of my postings won’t make any sense

Raymond Chen
Raymond Chen

This Web site is not for beginners. I try to write for advanced programmers, and if you're not an advanced programmer, then you'll just have to accept that there will be times you are baffled by what I write. Often I dial the geek back a notch, explaining some things which should be "obvious" to an advanced programmer, such as why storing a constant pointer into a stack location from dynamically-generated code is a clear indicator of a framework thunk. But I will dial it back only so far, and eventually you may just be forced to (horrors!) do your own background research to get yourself up to speed or simply gi...