{"id":19263,"date":"2009-02-04T10:00:00","date_gmt":"2009-02-04T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2009\/02\/04\/what-is-the-terminology-for-describing-the-various-parts-of-the-registry\/"},"modified":"2009-02-04T10:00:00","modified_gmt":"2009-02-04T10:00:00","slug":"what-is-the-terminology-for-describing-the-various-parts-of-the-registry","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20090204-00\/?p=19263","title":{"rendered":"What is the terminology for describing the various parts of the registry?"},"content":{"rendered":"<p>Hives, keys, values, types, and data.<\/p>\n<p> As I noted some years ago, <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2003\/08\/08\/54618.aspx\"> the file that holds the registry data is called a <i>hive<\/i><\/a>. <\/p>\n<p> A hive contains a tree of <i>keys<\/i>. <\/p>\n<p> Keys contain a list of <i>values<\/i>. <\/p>\n<p> Associated with each value is a <i>type<\/i> and <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2008\/01\/18\/7145021.aspx#7150918\"> <i>data<\/i><\/a>. <\/p>\n<p> The terminology is weird and counter-intuitive thanks to the history of the registry. Back in the days before named values, you queried the data associated with (the default value of) a key by calling <code>RegQueryValue<\/code>, which was a rather natural name since it matches the key\/value pattern. But the introduction of named <i>values<\/i> threw this pattern into disarray. Perhaps a better name could have been chosen for what today are known as values and data, but what&#8217;s done is done and that&#8217;s the name we&#8217;re stuck with. <\/p>\n<p> I&#8217;m sorry. <\/p>\n<p> <b>&#8220;Raymond, you idiot&#8221; section<\/b>: <\/p>\n<p> &#8220;Sure, Raymond, that&#8217;s the historical reason why the terminology is messed up, but <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2009\/01\/28\/9379262.aspx#9385549\"> why hasn&#8217;t anybody fixed it in the meantime<\/a>?&#8221; <\/p>\n<p> Well, changing terminology at this point would probably create even more confusion. For example, suppose you decide that the terminology should be changed as follows: <\/p>\n<table border=\"1\" rules=\"all\" style=\"border-collapse: collapse\">\n<col style=\"padding-left: 1em;padding-right: 1em\">\n<col style=\"padding-left: 1em;padding-right: 1em\">\n<tr>\n<th>Old<\/th>\n<th>New<\/th>\n<\/tr>\n<tr>\n<td>key<\/td>\n<td>node<\/td>\n<\/tr>\n<tr>\n<td>subkey<\/td>\n<td>subnode<\/td>\n<\/tr>\n<tr>\n<td>value<\/td>\n<td>key<\/td>\n<\/tr>\n<tr>\n<td>type<\/td>\n<td>type<\/td>\n<\/tr>\n<tr>\n<td>data<\/td>\n<td>value<\/td>\n<\/tr>\n<\/table>\n<p> I agree with you that this terminology would probably be much less confusing, but how do you get there from here? When you update all the documentation to change the terminology, how do you know that you covered everything? Do you grep for the word <i>key<\/i> everywhere and then decide on a case-by-case whether it should be changed to <i>node<\/i>? That&#8217;s probably some hundreds of thousands of hits just inside the MSDN Library. (Even worse with <i>value<\/i>, <i>type<\/i>, and <i>data<\/i>.) And then there are all the comments in source code that are now wrong. And all the magazine articles written prior to the change are now wrong; who&#8217;s going to go update them? And the existing source code needs to change <code>HKEY<\/code> to <code>HNODE<\/code> and <code>RegOpenKey<\/code> to <code>RegOpenNode<\/code>. Okay, so maybe you leave the old names around for compatibility, but now you have the problem that <code>RegOpenKey<\/code> returns a node, not a key, and that you pass a key name to <code>RegQueryValueEx<\/code>, and what the heck does <code>RegDeleteKey<\/code> do? Does it delete an old-key or a new-key? <\/p>\n<p> <b>Bonus chatter<\/b>: There&#8217;s also this thing called a <i>class<\/i>. I have no idea what it&#8217;s for, so don&#8217;t ask. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hives, keys, values, types, and data. As I noted some years ago, the file that holds the registry data is called a hive. A hive contains a tree of keys. Keys contain a list of values. Associated with each value is a type and data. The terminology is weird and counter-intuitive thanks to the history [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-19263","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>Hives, keys, values, types, and data. As I noted some years ago, the file that holds the registry data is called a hive. A hive contains a tree of keys. Keys contain a list of values. Associated with each value is a type and data. The terminology is weird and counter-intuitive thanks to the history [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/19263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=19263"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/19263\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=19263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=19263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=19263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}