I was taken aback by a developer's rant in Ars Technica today. What do Orgahs think? Is the Win32 API really so much worse than every modern API known to man?

Win32 is a big API; it's really huge, many thousands of API calls, and it's totally inconsistent. It's inconsistent in every way imaginable.

For example, many of the functions in Win32 require the caller to give a buffer to the function to store some data, and often that buffer has a size that's dynamic. Typically, the API can figure out how big the buffer needs to be, but the caller can't. A sensible software developer strives to solve the same problem the same way each time. It makes things easier for everyone concerned; it's easier for the software developer (because he only has to design one approach to doing it), and it's easier for people using his code (because they only have to learn one approach to doing it). There's no good reason to do it different ways. Yet Win32... Win32 does it in different ways.
  • Sometimes you can pass in an empty buffer and the function will tell you how big a buffer it needs.
  • Sometimes you have to pass in a small—but not empty—buffer and the function will tell you how big a buffer it needs.
  • Sometimes the function allocates a buffer from one of the standard Win32 memory allocators all on its own.
  • Sometimes the function allocates a buffer from a custom API-specific memory allocators all on its own.

Now, there might be some consistency in different portions of the API—the set of functions for dealing with backup/restore operations might all work in the same way, the set of functions for dealing with the registry might all be consistent, and so on. But while that might make sense to the people developing the OS, all in their own little teams, it's of no comfort to people like me who want to write Windows software.

I can't just use the registry API or the file API or DirectShow in isolation; I want to write a useful application. That means I have to deal with all of those things together. This makes the inconsistencies really jarring. I have to deal with them up close and personal. And it's frustrating and annoying. It makes things harder than they ought to be. With a well-designed library, you can learn one part of the library and apply that knowledge to other parts of the library. Because they work the same way. They're consistent. They reuse concepts in different places. Win32 isn't like that. Every little bit has got to be learned from scratch, because it's a schizophrenic mess.