The win32 API is dead

Jeff Waugh points me at another example of a large institution deciding to move away from Windows towards Linux. This is a growing trend — how many did we hear of these five years ago?

Joel raises a related and quite timely point:

However, there is a less understood phenomenon which is going largely unnoticed: Microsoft’s crown strategic jewel, the Windows API, is lost. The cornerstone of Microsoft’s monopoly power and incredibly profitable Windows and Office franchises, which account for virtually all of Microsoft’s income and covers up a huge array of unprofitable or marginally profitable product lines, the Windows API is no longer of much interest to developers. The goose that lays the golden eggs is not quite dead, but it does have a terminal disease, one that nobody noticed yet.” — Joel

It’s interesting that Joel specifically mentions Raymond Chen, who is the only Microsoft employee with an entry in the Linux kernel CREDITS file:

    N: Raymond Chen
    D: Author of Configure script
    S: 14509 NE 39th Street #1096
    S: Bellevue, Washington 98007
    S: USA

The article is a good read, even if it is quite long. Joel discusses how he thinks Microsoft has lost the API battle by forcing people into a large upgrade that they’re not going to agree to, and that web applications are where it’s at. He’s omitted and interesting point though — Microsoft’s API is further devalued by the open source implementations of .NET (Mono and dotGNU). Now I can implement a “Windows Forms” application which runs as well on Linux as it does with Windows. This is going to make it a lot harder for Microsoft to sell it’s cash cow Windows in the future as well.

In any case, simple operations like opening a file, writing a string, and closing it using the raw Windows API can take a page of code. In Visual Basic similar operations can take three lines.” — Joel

Ahhh, that would be why I feel so uncomfortable with the win32 API. Doing that with POSIX takes about three or four lines of code as well. Another example is memory mapping a file, which with POSIX takes about three lines, and with Windows takes about three pages and a day of research.