{"id":21383,"date":"2008-08-04T10:00:00","date_gmt":"2008-08-04T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2008\/08\/04\/why-when-you-sort-by-name-doesnt-it-actually-sort-by-name\/"},"modified":"2008-08-04T10:00:00","modified_gmt":"2008-08-04T10:00:00","slug":"why-when-you-sort-by-name-doesnt-it-actually-sort-by-name","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20080804-00\/?p=21383\/","title":{"rendered":"Why, when you sort by name, doesn&#8217;t it actually sort by name?"},"content":{"rendered":"<p>When you right-click on the desktop or in an Explorer window and select &#8220;Sort by&#8230; Name&#8221;, <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/pages\/407234.aspx#525547\"> why doesn&#8217;t it actually sort by name<\/a>?<\/p>\n<p> Because &#8220;Sort according to the default sort order for the column whose title is&#8230; Name&#8221; is too long. <\/p>\n<p> The default sort order for the first column (whose name is &#8220;Name&#8221;) is to sort by name, mostly. The actual sort order for the desktop and file folders (note: implementation detail, subject to change at any time) is really a two-tiered sort. First, the items are sorted into buckets; the first bucket contains the virtual folders, the second bucket contains file folders (directories), and the third bucket contains regular files. Sorting within the first bucket is done by the &#8220;item order&#8221;; sorting within the second and third buckets is by name. (And it&#8217;s <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2004\/05\/18\/134051.aspx\"> not by ASCII code any more<\/a>. There&#8217;s also <a href=\"http:\/\/blogs.msdn.com\/michkap\/archive\/2006\/09\/30\/778345.aspx\"> special treatment for numbers<\/a> and <a href=\"http:\/\/blogs.msdn.com\/michkap\/archive\/2006\/10\/01\/778990.aspx\"> periods<\/a>.) <\/p>\n<p> The &#8220;item order&#8221; (a term I just made up) for My Computer, My Documents, and Recycle Bin were specifically chosen in Windows&nbsp;95 so that the icons on the desktop appeared in that order. I believe it was in Windows&nbsp;2000 that the order was changed to My Documents, My Computer, Recycle Bin in order to put the focus on document management. <\/p>\n<p> (And those who have read Appendix&nbsp;A of <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2006\/12\/07\/1233002.aspx\"> my book<\/a> will know what sort of application compatibility problems arose from that simple change.) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you right-click on the desktop or in an Explorer window and select &#8220;Sort by&#8230; Name&#8221;, why doesn&#8217;t it actually sort by name? Because &#8220;Sort according to the default sort order for the column whose title is&#8230; Name&#8221; is too long. The default sort order for the first column (whose name is &#8220;Name&#8221;) is to [&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":[104],"class_list":["post-21383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>When you right-click on the desktop or in an Explorer window and select &#8220;Sort by&#8230; Name&#8221;, why doesn&#8217;t it actually sort by name? Because &#8220;Sort according to the default sort order for the column whose title is&#8230; Name&#8221; is too long. The default sort order for the first column (whose name is &#8220;Name&#8221;) is to [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/21383","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=21383"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/21383\/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=21383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=21383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=21383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}