When people mimic the display rather than the actual data

Date:May 12, 2006 / year-entry #164
Tags:other
Orig Link:https://blogs.msdn.microsoft.com/oldnewthing/20060512-10/?p=31223
Comments:    25
Summary:I recall a bug that we were investigating that was being caused by a registry key being set when it shouldn't have been. But when you looked at the key in Regedit, it say "(value not set)". Why were we going down the "value is set" branch? A little spelunking with the debugger revealed the...

I recall a bug that we were investigating that was being caused by a registry key being set when it shouldn't have been. But when you looked at the key in Regedit, it say "(value not set)". Why were we going down the "value is set" branch? A little spelunking with the debugger revealed the reason directly: Whoever set up that registry key wrote the literal string "(value not set)" to the registry! Thus, the value was set, to the string "(value not set)"!

We were flabbergasted. The only explanation we could come up with was that whoever created the registry key didn't understand that the "(value not set)" was shown by Regedit for a key with no value. Instead, they figured "Oh, I need it to look like that, so I'll set the value to '(value not set)'. Now it looks right in Regedit."

Along similar lines, I've been told of a system which appeared to have two (Default) values. As you can probably guess by now, what really happened is that somebody created a value whose name was "(Default)".

The moral of the story is not to confuse what something is with what something looks like.


Comments (25)
  1. Wang-Lo says:

    This was probably written by a developer who complains about the horrible quality of Microsoft documentation when in fact he has not read any of it.

    That is an all too common attitude.  I am eagerly awaiting the hilarity that will ensue when the EU gets around to demanding that Microsoft "document the contents of the registry".

    -Wang-Lo.

  2. Skott Klebe says:

    Well, it’s also a UI design bug, if it’s possible for a null value to appear identical to any data value.  Bold text, a color highlight, a little animated stick figure waving an "I’m null!" flag – anything that you couldn’t simulate by setting a value – all would have saved you some debugging time, and possibly prevented the (boneheaded) defect in the first place…

  3. You see somehing similar for ID3 tags in Windows Media Player’s library. Sometimes you will see two sets of ‘Unknown’ under each field type. The one at the top corresponds to those with no information for that field, whereas the one that’s in alphabetical order is the one where someone has put ‘Unknown’ into the field.

  4. some coworkers battled for several hours because some person’s last name was "NULL"… and they were pretty sure that the query had ‘is not null’

  5. tsrblke says:

    I was once given the task of editing a MS Word built form.  At the time I didn’t know that forms had to be "protected" to make them fill in forms.  Anyway, I spent forever trying to figure that out. Finally I found the "Unprotect" button, and clicked it.  Only to be asked for a password.  I tracked down anyone who would have remembered the person who built the form.  Only to be told over and over again.  "There is none."  "We never would have passworded it."

    Finally in desperation a friend found me a password cracker.  I ran it.

    Password: none

    Ok that’s a bit strange, so I went in and tried "none."  Sure enough it worked.  Apparently it said something to the effect of "Enter Password, or none" and so the person who built it took that too literally.

  6. UWho says:

    I used to torment my friends in the DOS days by making a file with the contents of "Access Denied".

  7. Vorn says:

    Cargo Cult Programming!

    Vorn

  8. David Candy says:

    HKEY_CLASSES_ROOTDirectoryshell

  9. (Null) says:

    "(Null)" is fun to place in VARCHAR-fields in SQL Server. Have done it lots of times just to wreck havoc.

  10. Mike says:

    For someone as R.C. this may be nonsense, but combine this program with how Regedit works (or at least worked – only us oldtimers knew about regedt32 I suspect) and this is the *obvious* design of that software.

    The blame is 100% at Microsoft in this case, and the one(s) designing Regedit for Win95 (not to mention the fools that just copied its source code verbatim up to, but not including NT5.1).

    Raymond is likely aware of "Do as I say, not what I do". Microsoft has a long history of doing many, many things wrong…

    Don’t blame the designer of the flawed software. Blame the one designing this in Win95 (I’d laugh my ass off is this was an area R.C. was involved in).

  11. R. Bemrose says:

    "some coworkers battled for several hours because some person’s last name was "NULL"… and they were pretty sure that the query had ‘is not null’"

    Was the problem on the software end (i.e. it treated NULL and "NULL" as the same) or was it PEBKC?

  12. Michael Buschbeck says:

    Well… it isn’t quite so implausible that software might treat the literal string "(value not set)" specially to represent a null value on both output *and* input.  Perhaps Regedit should display such non-values in a way that clearly distinguishes them from any possible actual value, as Skott Klebe said.

    I’ve long abandoned the thought that the line between "Of *course* it does this!" and "Of *course* it doesn’t do this!" in regard to software is anywhere near being clearly visible to anybody without specific experience with the program in question.  I could easily imagine a blog posting in an alternate universe about how people simply didn’t have the common sense to type "(value not set)" in a text box to unset a value, even though they could plainly see that other unset values looked just like that.  (Yes, a decent programmer probably wouldn’t make a program like that, but users generally have no concept of what a decent programmer would do.)

    BTW: I recently dropped something in the Suggestion Box but was so incautious to include a URL (oh my!) to an article by Joel Spolsky in my posting.  It hasn’t shown up yet.  Could it be that it has been auto-deleted by some overeager spam filter?

  13. I swear that I almost ruined a keyboard yesterday by taking a sip of Limonata just before I read Raymond…

  14. Mike Dunn says:

    I recall seeing a question on a board once asking how to know at runtime what name to pass for the default value. You know, because it’s "(Default)" in English, "(Défaut)" in French, and so on.

  15. Norman Diamond says:

    Along similar lines, I’ve been told of a

    > system which appeared to have two (Default)

    > values. As you can probably guess by now,

    > what really happened is that somebody

    > created a value whose name was "(Default)".

    Thank you for posting this.  But I wonder why you didn’t say which company did this?  Sometimes you’ve admitted that a certain company is as much at fault as others, and such admissions do help overcome perceptions of hypocrisy.

    > I recall seeing a question on a board once

    > asking how to know at runtime what name to

    > pass for the default value. You know because

    > it’s "(Default)" in English, "(Défaut)" in

    > French, and so on.

    And it’s (既定) in Japanese.  Belatedly I thought of looking at the same registry key in a real system instead of an MSDN English language version.  There it was,

    (既定) whatever the value was (maybe not set)

    followed by

    (Default) some value.

    Then I figured out the breakage wasn’t in Regedit.

  16. PatriotB says:

    David Candy — I think that use of "none" may be intentional; there are a few other shell keys that also have a value of none, such as the one for My Computer: HKCRCLSID{20D04FE0-3AEA-1069-A2D8-08002B30309D}shell.  It may be a way to signal to the shell that none of the verbs within the subkey should be the default verb?  MyComputer and FileFolder are specialized kinds of Folder; the HKCRFoldershell key is where the open and explore verbs live, and MyComputer and FileFolder seem to inherit all these verbs.  The "none" must be a way to signal that the FileFolder-specific verbs shouldn’t be made default and that the Folder-default verb should remain the default.  (I don’t believe any of this is documented anywhere in the shell documentation…)

  17. PatriotB says:

    Er, make that "Directory" instead of "FileFolder" above…

  18. Jules says:

    I’m with Scott.  It’s a UI design bug for a data editor if two semantically distinct configurations of data can be displayed in such a way that you can’t distinguish between them.  There should be a separate "type of entry" column or something like that so that you can distinguish between the possibilities.

  19. This is just another version of the problem of using a string for a special value.  An old version of this problem is the customized license plate "NO PLATE".

    http://www.snopes.com/autos/law/noplate.asp

  20. Neil says:

    Presumably history does not relate whether the "(Default)" value’s data was "(value not set)" ?

  21. Norman Diamond says:

    Thursday, May 18, 2006 12:37 PM by Neil

    > Presumably history does not relate whether

    > the "(Default)" value’s data was "(value not

    > set)" ?

    History has nothing to do with it.  Windows XP has this:

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled Components{5A8D6EE0-3E18-11D0-821E-444553540000}

    (既定)     (値の設定なし)

    (Default)  Internet Connection Wizard

    In an English language installation it looks something like this:

    (Default)  (value not set)

    (Default)  Internet Connection Wizard

    So the real default isn’t set, but a critical component of Windows operating systems provides a window into the maker’s operations.

  22. Norman Diamond says:

    Here’s another.  Sorry for posting twice in a row, but I’ll refrain from a third one.  Two should be enough to show it’s not a one-off.  This one isn’t a crucial component of Windows operating systems but it still gives us a window into some operations.

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows CE ToolsManaged Platforms{600000D1-8A5F-11D7-BE0C-0008744F3D24}

    (既定)     (値の設定なし)

    (Default)  Managed Platform

Comments are closed.


*DISCLAIMER: I DO NOT OWN THIS CONTENT. If you are the owner and would like it removed, please contact me. The content herein is an archived reproduction of entries from Raymond Chen's "Old New Thing" Blog (most recent link is here). It may have slight formatting modifications for consistency and to improve readability.

WHY DID I DUPLICATE THIS CONTENT HERE? Let me first say this site has never had anything to sell and has never shown ads of any kind. I have nothing monetarily to gain by duplicating content here. Because I had made my own local copy of this content throughout the years, for ease of using tools like grep, I decided to put it online after I discovered some of the original content previously and publicly available, had disappeared approximately early to mid 2019. At the same time, I present the content in an easily accessible theme-agnostic way.

The information provided by Raymond's blog is, for all practical purposes, more authoritative on Windows Development than Microsoft's own MSDN documentation and should be considered supplemental reading to that documentation. The wealth of missing details provided by this blog that Microsoft could not or did not document about Windows over the years is vital enough, many would agree an online "backup" of these details is a necessary endeavor. Specifics include:

<-- Back to Old New Thing Archive Index