March, 2009

  • The Old New Thing

    Engineering is about tradeoffs: How hard will you work to save 68KB of disk space?

    • 84 Comments

    One of the recurring themes in the comments to my explanation of the historical reasons why there are two copies of Notepad was to use a hard link (or possibly a symbolic link) to save having to waste the disk space for two whole copies of Notepad. As I like to say, engineering is about tradeoffs. Let's look at the cost-benefit analysis.

    On the one hand: Install two copies of Notepad. Cost: 68KB of disk space.

    On the other hand: Use hard links or symbolic links. Cost: Add support for hard links or symbolic links to the FAT filesystem, to the operating system Setup program, to file formats such as the Windows Imaging Format, and to the various disk duplication systems that system builders (and corporate customers) use for deploying Windows to thousands of machines. Don't forget to count the cost for design and testing.

    Imagine you're the scheduling manager for the Setup team. Which of these two options do you choose? 68KB of disk space or doing all the work to support hard links during Setup and then waiting for all the existing customers to upgrade their tools to versions which support hard links—which could take several years. Are you going to be the one to have to stand up in the Ship Room and say, "We can't ship Windows because ten of our customers hasn't upgraded their deployment tools yet, and I have no idea how long we're going to have to wait until they do"?

    And for those commenters who said that Windows should just get rid of one of the copies, you'll be pleased to know that Windows Server 2008 got rid of the copy in the Windows directory. There is now only one copy¹ of Notepad, and it's the one in the system32 directory. It wasn't long after the product was released that I learned of a program that hard-coded the one that no longer exists; I wish the vendors good luck in getting a patch out quickly.

    Footnotes

    ¹Nitpickers not welcome here. There is only one copy remaining of the two under discussion.

  • The Old New Thing

    I drive a car the way most people use a computer

    • 82 Comments

    It was interesting to me reading the reactions to my adventures driving a manual transmission. People seemed to be spending a lot of time trying to convince me that if only I were to expend a bit more effort in learning the finer points of driving a manual transmission and log enough time behind the wheel, then the activity will become less taxing on my mental brainpower.

    But why should I care?

    To me, driving is not an end in itself. It is just a tool for solving the problem of getting from point A to point B. The less I have to learn about how to accomplish this task the better.

    My goal is not to become a car expert. My goal is to get to my destination conveniently. I don't want to "have greater control over the experience"; I don't want "more power"; heck, depending on where I'm going, I often prefer to take the bus, where I have no control over the experience at all!

    It occurred to me as I read commenter after commenter try to convince me that my own personal priorities were incorrect that I drive a car the same way most people use a computer. They don't want to know about the difference between ROM and RAM or how many floppy disks you can store in a 6 megabit cable modem. They just want to surf the web, send email, and look at pictures of their grandchildren. (Okay, they may want to do other stuff too, but knowing the difference between PIO and DMA is definitely not on the list.)

    There's no point trying to get these people to learn all these details about how computers work because they don't care. They just want to know where they need to click to see that picture of baby Annie. You can even tell them that the way they're doing it is suboptimal and there's a much more powerful way to view those pictures which also gives them the ability to alter the gamma curve and apply the correct color adjustment to the image to match their monitor's color temperature, but they won't care.

    And I don't blame them. Because I don't care either.

  • The Old New Thing

    Caption contest: The pinball machine

    • 56 Comments

    I may regret this, but here's something new: A caption contest. One of my colleagues saw this picture on a company's Web site.

    Pinball machine with flipper about to strike ball.

    The original caption for this picture was something like Join our affiliate program or Score big with our affiliate program. Your mission is to come up with something funnier. Here are some ideas to get you started:

    • Do you have balls of steel? Maybe you can become an affiliate.
    • We love to flip off our affiliates.
    • When you become an affiliate, you're going to get whacked around a lot.
    • Sooner or later you'll end up in the hole.
    • We like to play games with you. Become an affiliate today!

    Now it's your turn. Keep it friendly.

  • The Old New Thing

    The perilous quandary of including external drivers on the Windows CD

    • 53 Comments

    (Technically, it's probably more a dilemma than a quandary, but I like the phrase perilous quandary.)

    Driver coverage is always a sticking point for Windows deployments. If the Windows CD doesn't include a driver for your particular hardware, you're probably going to say, "Windows sucks. I installed the latest version on my machine and it didn't work with my video card/sound card/network card/whatever." The people who are responsible for deciding which drivers are included on the CD have to balance a lot of factors. How popular is the hardware? Will the hardware vendor allow Microsoft to include the driver on the Windows CD? Is the vendor willing to spend the additional effort to get the driver WHQL-certified?

    Even after Windows ships, the struggle is not yet over. I was reminded of this when I learned of a hardware vendor whose driver on the Windows CD was discovered to contain a security flaw. The following is a completely fictionalized version of the conversation that took place with the vendor.

    "Hey, it looks like there's a security flaw in the driver you gave us to include on the Windows CD. «details omitted» Can you take a look at it and tell us what you think?"

    — Yes, it appears to be a flaw in the x.y version of the driver. It is fixed in the x.z version.

    "Great, can you send us a copy so it can be made available on Windows Update?"

    — No, we'd rather distribute the updated driver through our resellers.

    "Our data (based on information anonymously and voluntarily provided by Windows users) shows that of all the Windows customers who have your hardware, only 5% of them are running version x.z or higher of your driver. The rest are still running version x.y or earlier. Please reconsider your decision."

    — Thanks for the offer, but we would prefer to distribute the updated driver through our resellers.

    Negotiations continued for three months before the vendor agreed to allow the updated driver to be distributed on Windows Update.

  • The Old New Thing

    The house no-electronics zone

    • 48 Comments

    In my house, I have designated two rooms as the no-electronics zone. No use of electronic gadgets is allowed. No television, laptops, PDAs, cell phones, handheld video games, you get the idea. The purpose of this section of the house is to interact with other people face-to-face.

    Now, exceptions have been made for extenuating circumstances. For example, when some of my friends were without electricity due to a power outage, I invited them to my house, and they were permitted to use their laptops in what would normally be the no-electronics zone.

    But those are the exceptions. So if you come to my house, remember: The living room and dining room form a no-electronics zone.

    [Update 1pm] Return of the nitpicker's corner: Once again, people get distracted by the minutiae and miss the point of the rule. The purpose of the rule is to encourage face-to-face interaction and to discourage activities which cause people to withdraw from each other.

    By electronic devices, I mean televisions, laptops, PDAs, cell phones, handheld video games, you get the idea. Digital watches, clocks, and lamps are acceptable, provided they do not prevent you from interacting with others. Checking the time is okay; playing Space Invaders on your digital watch is not. Digital cameras are acceptable if they are being used to take or share pictures. But sitting there sifting through pictures without talking to anyone is not.

    If Professor Stephen Hawking comes to visit, his electronic devices are being used to interact with other people and are therefore acceptable.

    I didn't feel the need to apply these common-sense rules to the basic principle, assuming that my readers understood the point I was making and didn't need a legalistic breakdown of what is and is not acceptable.

  • The Old New Thing

    Why is the Win32 epoch January 1, 1601?

    • 41 Comments

    Public Service Announcement: This weekend marks the start of Daylight Saving Time in most parts of the United States.

    The FILETIME structure records time in the form of 100-nanosecond intervals since January 1, 1601. Why was that date chosen?

    The Gregorian calendar operates on a 400-year cycle, and 1601 is the first year of the cycle that was active at the time Windows NT was being designed. In other words, it was chosen to make the math come out nicely.

    I actually have the email from Dave Cutler confirming this.

  • The Old New Thing

    You can't globally reserve screen space; you can put up signs, but if somebody ignores the sign you'll have to decide how to respond

    • 41 Comments

    A customer sent the following question with the rather unhelpful subject line Need Help. They're not just looking for help; they're looking for Help with a capital H.

    We want to make something like an appbar, but without some of the limitations of appbars. For example, like an appbar, we want applications to avoid using the edge of the screen. The section of the screen the window appears on should be "mine"; nobody else should be permitted to use it. The window should always be on top; nothing should be able to cover it. For example, Internet Explorer in fullscreen (F11) mode should not cover our window; it should go behind.

    In other words, you want to create a window that is never covered by any other windows, not even other topmost windows. There are two groups fighting over the same thing. One of them will lose. That loser is you.

    Everquest/PowerPoint/Picasa/etc team: "I want to cover the screen."

    You: "I want to prevent programs from covering the screen."

    Everquest/PowerPoint/Picasa/etc team: "I want to cover the screen, even if there is a program that wants to prevent me from covering the screen."

    You: "I want to prevent programs from covering the screen, even if there is a program that is overriding my attempt to prevent them from covering the screen."

    Everquest/PowerPoint/Picasa/etc team: "I want to cover the screen, even if there is a program that wants to prevent me from overriding their attempt to prevent me from covering the whole screen."

    You: "Infinity!"

    Everquest/PowerPoint/Picasa/etc team: "Infinity plus one!"

    Creating an appbar says, "If you want to maximize your window, use the part of the screen that I'm not using." But if a program creates a window of size SM_CXVIRTUALSCREEN by SM_CYVIRTUALSCREEN, then it has done it and what are you going to do? You can't prevent them from doing it, but you can make your wishes known and respond intelligently when they choose to ignore you.

    You can build a sign that says "no trespassing" but that doesn't prevent people from trespassing. If somebody walks onto your property right past your "no trespassing" sign, then they have done it and now you have to decide what action you're going to take in response.

  • The Old New Thing

    What's the point of the MoveWindow function when we already have SetWindowPos?

    • 36 Comments

    Commenter Phil Quirk notes via the suggestion box, "MoveWindow is just a weird function. I guess it's easier to call than SetWindowPos, but that's the only thing it seems to have going for it."

    Yup, that's about right.

    The MoveWindow function doesn't really do anything you couldn't already do yourself with SetWindowPos. It's just a convenience function. And it you look at it pretty closely, it's really not that big of a convenience either, saving you one parameter (hwndInsertAfter) and replacing the flag SWP_NOREDRAW with a boolean parameter.

    Whoop-dee-doo.

    It shouldn't take too much imagination to figure out how this situation came about. It's the same reason why you have both CreateWindow and CreateWindowEx.

  • The Old New Thing

    Double secret auto-arrange probation

    • 35 Comments

    When you view a folder for the first time, Explorer arranges the items in a nice default pattern. And when items are added to the folder, they get added to the end. And when you delete an item from the folder... the other items auto-arrange to close the gap? But wait, if you look at the View options, the Auto-Arrange option is not set.

    So are we auto-arranging or not auto-arranging?

    Well, yes, but only until you touch it.

    As long as you express no interest in the placement of icons in a folder (and the desktop counts as a folder), then Explorer will auto-arrange them. But once you move an icon around, Explorer will turn off its double secret auto-arrangement and leave the icon arrangement to you.

    (Programmatically, this mode is known as LVS_EX_AUTOAUTOARRANGE.)

  • The Old New Thing

    Overheard conversation fragment: Shrimp is not vegetables

    • 33 Comments

    I walked past a woman in the grocery store who was talking on her mobile phone. I only caught one sentence. She said, in an annoyed voice, "Shrimp is not vegetables."

    (Then again, purple is a fruit, so anything's possible.)

    Update: manicmarc correctly deduced that the tone and body language of the person on the phone indicated that her previous sentence in the conversation was something like "What vegetables do you want to have with dinner?"

Page 1 of 4 (33 items) 1234