Where did WIN32_LEAN_AND_MEAN come from? (2009)
The WIN32_LEAN_AND_MEAN symbol, introduced during the Windows 95 era, serves a specific purpose in C programming. When included with windows.h, it allows programmers to exclude a number of Windows header files, thereby adopting a more streamlined approach akin to the 16-bit Windows philosophy. This method brings back a minimalist set of header files, which is particularly beneficial in an age when precompiled header files were not yet commonplace.
On a 50MHz 80486 system with 8MB of memory, enabling WIN32_LEAN_AND_MEAN could potentially shave three seconds off the compilation time for each C file. For projects comprising around 20 C files, this translates to a significant saving of nearly a minute. Despite the advent of faster processors and precompiled headers, the symbol has become somewhat obsolete.
However, during its inception, it provided a valuable solution for programmers who preferred to manage their header files meticulously. Raymond Chen, a tech historian involved in Windows development for over three decades, has chronicled the evolution of Windows since 2003 through his popular blog, The Old New Thing. His work has been published in a book of the same name, and he occasionally contributes to the Windows Dev Docs Twitter account, sharing anecdotes that may not always be immediately useful.
Rewritten by urgent.news; may contain errors — check the original.
Source: devblogs.microsoft.com