Remember that the Windows API was first created back in the 1980's, and has had to support several different CPU architectures and compilers over the years. They've gone from single-user single-process standalone systems to networked multi-user multi-core security-conscious systems. They had to work around issues with 16-bit vs. 32-bit processors, and now 64-bit processors. They had to work around issues with pre-ANSI C compilers. They had to support C++ compilers in the early unstandardized times. They had to deal with segmented memory. They had to support internationalization before Unicode existed. They had to support some source-level compatibility with MS-DOS, with OS/2, and with Mac OS. They've had to run on several generations of Intel chips, and PowerPC, and MIPS, and Alpha. The same basic API is also used on mobile phones, handhelds, and many types of embedded systems.
Also, back in the 1980's, C was considered to be a high-level language (yes, really!) and many people considered it good form to use abstractions rather than just specifying everything as an int
, a char
, or a void *
. Back when we didn't have IntelliSense and infotips and code browsers and online documentation and the like, such usage hints were very helpful.
Yes, it's a horrible mess, but that doesn't mean they did anything wrong.