{"id":15863,"date":"2009-11-30T07:00:00","date_gmt":"2009-11-30T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2009\/11\/30\/where-did-win32_lean_and_mean-come-from\/"},"modified":"2009-11-30T07:00:00","modified_gmt":"2009-11-30T07:00:00","slug":"where-did-win32_lean_and_mean-come-from","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20091130-00\/?p=15863","title":{"rendered":"Where did WIN32_LEAN_AND_MEAN come from?"},"content":{"rendered":"<p>Commenter asdf wonders <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/pages\/407234.aspx#705378\"> where <code>WIN32_LEAN_AND_MEAN<\/code> came from<\/a>.\n The <code>WIN32_LEAN_AND_MEAN<\/code> symbol was introduced in the Windows&nbsp;95 time frame as a way to exclude a bunch of Windows header files when you include <code>windows.h<\/code>. You can take a look at your <code>windows.h<\/code> file to see which ones they are.\n The symbol was added as part of the transition from 16-bit Windows to 32-bit Windows. The 16-bit <code>windows.h<\/code> header file didn&#8217;t include all of those header files, and defining <code>WIN32_LEAN_AND_MEAN<\/code> brought you back to the 16-bit Windows philosophy of a minimal set of header files for writing a bare-bones Windows program. This appeased the programmers who liked to micro-manage their header files, and it was a big help because, at the time the symbol was introduced, precompiled header files were not in common use. As I recall, on a 50MHz 80486 with 8MB of memory, switching to <code>WIN32_LEAN_AND_MEAN<\/code> shaved three seconds off the compile time of each C file. When your project consists of 20 C files, that&#8217;s a whole minute saved right there.<\/p>\n<p> Moore&#8217;s Law and precompiled headers have conspired to render the <code>WIN32_LEAN_AND_MEAN<\/code> symbol relative useless. It doesn&#8217;t really save you much any more. But at one point, it did. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Commenter asdf wonders where WIN32_LEAN_AND_MEAN came from. The WIN32_LEAN_AND_MEAN symbol was introduced in the Windows&nbsp;95 time frame as a way to exclude a bunch of Windows header files when you include windows.h. You can take a look at your windows.h file to see which ones they are. The symbol was added as part of the [&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":[2],"class_list":["post-15863","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Commenter asdf wonders where WIN32_LEAN_AND_MEAN came from. The WIN32_LEAN_AND_MEAN symbol was introduced in the Windows&nbsp;95 time frame as a way to exclude a bunch of Windows header files when you include windows.h. You can take a look at your windows.h file to see which ones they are. The symbol was added as part of the [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/15863","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=15863"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/15863\/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=15863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=15863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=15863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}