Slashdot Mirror


Joel On Microsoft's API Mistakes

AceMarkE writes "Joel Spolsky of Joel on Software has posted an article entitled "How Microsoft Lost the API War". He covers why the Win32 API is important to Microsoft, what they've done to keep it working, why Microsoft's switch to the .Net platform is both a good and bad idea, and why he feels the browser will be the real future of application development. Definitely worth a read no matter what your opinion of Microsoft is."

21 of 690 comments (clear)

  1. Repeating my comment on OSNews... by RAMMS+EIN · · Score: 5, Insightful

    I have 2 comments:

    1. Web clients vs. rich user interfaces

    I have long wondered why web interfaces aren't much good. The technologies are there; Java applets, Flash, Python could do it, JavaScript could with a few extensions, XUL, heck, even C, compiled on the fly. All these stop just short of integrating well with the web and the client platform. Why? Why has nobody managed (or tried) to take the last step? Even .NET doesn't go there; the GUI interface is very much tied to Windows.

    2. API changes

    Contrary to Microsoft's, UNIX and POSIX APIs have been very stable. There have been extensions, but the bulk of what used to work still works. This makes the case for switching over to standard technologies, now that Microsoft is pushing you to switch anyway.

    --
    Please correct me if I got my facts wrong.
    1. Re:Repeating my comment on OSNews... by ispeters · · Score: 5, Informative

      It's not exactly sockets, but you can do an awful lot with the XmlHttpRequest object. Microsoft did it first, I think, and Mozilla has a complete clone. Check out the XulPlanet documentation, the Mozilla documentation, the Microsoft documentation or this tutorial called Using the XML HTTP Request Object

      The XmlHttpRequest object is poorly named. Really you're just making an HTTP request, and if the response happens to be XML, there are convenience functions for getting a fully-parsed DOM view of the document. If the response is anything else (plain text, JavaScript, Perl, HTML, etc.) you can do what you want with it, including calling eval() on it from a JavaScript script. You can do synchronous (blocking) or asynchronous (non-blocking) calls to your web server, and either be notified of completion by a callback for non-blocking calls, or just treat it like a function call for blocking calls. It's quite handy, and we have a project at work that makes extensive use of this technique. We have a "thick" or "rich" client application that runs in the web browser. Our client looks like a native application--it has table widgets, with clickable headers that resort the columns, it has a tree widget that looks like the tree in Windows Explorer, it supports drag-and-drop and custom context-menus, and if you open our application in a chrome-free browser window, it's almost possible to forget it's not native (the speed is usually what gives it away, the GUI is a little sluggish...). It works equally well in Mozilla, Firefox, IE 5.5+, and Netscape 7.1+ on Windows 9x, 2000, XP, and many flavours of GNU/Linux (tested on Gentoo and Redhat 7.3, and 8.0 using GNOME, KDE, and some kind of *Box wm). Well, "equally well" is a bit of a stretch. IE's implementation of the DOM is dog slow, so some things run a bit faster in the Gecko-based browsers, but all functionality is equally available in all the configurations listed above. We've managed to stay standards-compliant for the most part, and have abstracted away the quirks in IE, so as soon as Konqueror, Opera and $YOUR_FAVOURITE_BROWSER fully support JavaScript 1.5, DOM 2.0, and CSS 2.0, our app will work in your browser, too. (I don't know which parts these browsers are missing, so maybe our app already works there.)

      The only remaining hurdle is to convince management that it should be open-sourced so that other people can use it, too. If you can't wait, you might want to check out SourceForge. There are some other widget kits available for building browser-based apps. We chose not to go with them because, at the time, they were too Alpha-ish, and we disagreed with some design decisions. Our decision not to use those projects has not been revisited for a while though, now that we are rather comitted to our in-house implementation, so things may have improved significantly since the last time I had a look.

      Also, if you're going to actually build any significant JavaScript apps (we have more than 40k loc that turns out to be more than 1 meg of JavaScript to download), I highly recommend JSDoc. The main developer, Gabriel, has been very responsive and helpful, and the documentation that his scripts produce is excellent. Especially considering he builds JSDoc in his spare time, I can't compliment his work enough. Now that our codebase is too large for me to keep it all in my head, the API has saved a lot of my time.

      Ian

    2. Re:Repeating my comment on OSNews... by Spy+Hunter · · Score: 5, Insightful
      This article is great, Joel is a genious, and it's all because of the one paragraph in the article where he answers your question #1.

      Joel has explained the reason Internet Explorer's development hit a wall a year or two ago. All you people asking why Internet Explorer's standards compliance hasn't gotten any better, why it hasn't gotten tabbed browsing, etc, now you have your answer. It's a very good reason (for Microsoft), and it's obvious in retrospect, but I sure didn't think of it until I read these few sentences:

      Promising new technologies like HTAs and DHTML were stopped in their tracks. The Internet Explorer team seems to have disappeared; they have been completely missing in action for several years. There's no way Microsoft is going to allow DHTML to get any better than it already is: it's just too dangerous to their core business, the rich client.

      Microsoft can't afford to make IE any better, because if was improved one or two generations more, the kinds of web applications that would become possible would make Windows irrelevant as a platform. Everyone would be developing for the web instead of Win32 or .NET or Avalon or whatever. Internet Explorer development has come to a screeching halt except for things which are absolutely necessary to avoid losing its #1 browser position (because for Microsoft the only thing worse than an improved IE is an improved Mozilla!). This is the reason why.

      --
      main(c,r){for(r=32;r;) printf(++c>31?c=!r--,"\n":c<r?" ":~c&r?" `":" #");}
  2. Re:Why it has to die by Anonymous Coward · · Score: 5, Informative

    A closed set of poorly documented APIS

    Say what you like about MS's evil ethics but *do not* mock their API docs. They're very good.

  3. Hard to be a Mac user? by Anonymous Coward · · Score: 5, Insightful
    Remember, people buy computers for the applications that they run, and there's so much more great desktop software available for Windows than Mac that it's very hard to be a Mac user.


    No it isn't, it's easy to be a Mac (OS X) user. No Viruses, No Trojans, a sytem that stays up pretty much indefinitely, and great, great applications that do everythinbg I need and much more besides that I probably don't really need, if I'm honest. This old argument about Mac having no apps is very old, very tired, and very tiresome. Please stop.
  4. Re:Why it has to die by Tranzig · · Score: 5, Insightful

    The reason for the death of the API is probably GNU/Linux. A closed set of poorly documented APIS
    doesn't compare to much to "We'll give you the source code"

    Microsoft Developer Network has comprehensive documentation about the Microsoft APIs. When I was developing for Windows platform, I never needed any documentation other than MSDN. And if you want source code, you can download the SDKs for free. Though it contains only sample codes, I wonder how many Linux developers looked at the sources of the APIs they use. I have never did such a thing.

  5. Re:Why it has to die by Carnildo · · Score: 5, Interesting

    I've programmed for Win32, MacOS Classic, and MacOS Carbon. Of those APIs, Win32 was the easiest to use and had the best documentation. Carbon came in second, with Classic a very distant third.

    --
    "They redundantly repeated themselves over and over again incessantly without end ad infinitum" -- ibid.
  6. As a (former) die hard web developer by Omega1045 · · Score: 5, Insightful

    I used to preach the "web is everything" argument from every soap box I could. I don't think HTTP and HTML will cut it for the types of interactive programs we will see in the future. Heck, in many cases they don't cut it now.

    I can see technologies like SOAP enabling rich clients to interop across platforms (ok MS haters, SOAP is a mult-vendor thing so don't reply telling me some tinfoil hat story on how MS will patent SOAP and sue anyone who uses it without license). I am willing to bet some other protocols similar to SOAP, or perhaps riding on top of SOAP, will come along to allow richer communication across networks. HTML just isn't going to do it.

    While I totally agree that open standards and open source make the best APIs, MS failed way before even that line. Take SMB for example. Their systems, by design or mistake, don't even follow their own standard! I am betting it is a little of both. Their APIs are this way as well. What is really hurts MS in this particular area is poor documentation and poor implimentation of their own APIs. Having worked with .NET for about 2.5 years now I can go into my office and find any number of contradictory statements about the .NET APIs, statements published my MS! I think this is hurting them quite a bit.

    --

    Great ideas often receive violent opposition from mediocre minds. - Albert Einstein

  7. And people say.... by jwcorder · · Score: 5, Funny
    "The testers on the Windows team were going through various popular applications, testing them to make sure they worked OK, but SimCity kept crashing. They reported this to the Windows developers, who disassembled SimCity, stepped through it in a debugger, found the bug, and added special code that checked if SimCity was running, and if it did, ran the memory allocator in a special mode in which you could still use memory after freeing it.

    And people say the evil giant doesn't try to fix it's software. They fixed SimCity DAMN IT!

    --
    http://jayceecorder.blogspot.com
  8. Re:This was not an unusual case by Anonymous Coward · · Score: 5, Funny

    Remember, "It's not done till Lotus won't run!"

  9. Re:Prophecy by tedhiltonhead · · Score: 5, Insightful

    Umm... HTML and HTTP *are* open standards that are backed heavily by Microsoft that give power and flexibility to developers. :)

    If you were using something other than HTML and HTTP, you wouldn't be doing Web development; you'd be doing some other kind of development.

    Macromedia Flash applications backed by SOAP look very interesting for apps requiring more GUI-like, real-time interaction. This is basically what Java applets were intended for.

  10. Re:Why it has to die by mangu · · Score: 5, Insightful
    Microsoft Developer Network has comprehensive documentation about the Microsoft APIs.


    Comprehensive up to a point. In fact, not comprehensive at all. People have sold books, profitting from Microsoft's incomplete documentation. I think the grandparent post is somewhat exagerated in saying that it was Linux that made Microsoft put aside the API. However, in my particular case, it was the incomplete API documentation that made me stop using NT and start programming in Qt in Linux. I tried and tried, and there was no way I could make a data acquisition program I was writing to work well under NT 4. I did exactly what the MSDN documentation said. Then, in desperation, I tried to learn Qt. 20 minutes after starting to read the Qt documentation I had my first non-trivial working Qt program. That was in 1998, and I never wrote a MS-Windows program ever since. I have migrated with little effort my MFC programs to Qt/KDE. I only need three sources of documentation: qt3-assistant, Johnson & Troan's "Linux Application Development", and Rubini's "Linux Device Drivers". Plus the thousands of sites in the web where I can find source code for Linux, of course. A complete documentation is good, but nothing can replace a good set of examples.

  11. Re:Why it has to die by Malc · · Score: 5, Interesting

    Poppycock! When I write code under Linux, I go to man and Google first, not the source. In my experience, the MSDN library is more than a match - it's very good documentation. The problem is the sheer number of APIs under Windows..

    Most of my work these days is under Windows, and I will freely admit that on occasion I have used the source that Microsoft provides. That's right, I have the source to MFC, C library, ATL, WTL, etc. It's not due to lack of documentation though. I often debug in to assembly code, but it's normally to get to somewhere else (e.g. step in to the COM libraries to reach my COM code) and the debug symbols that are freely available normally suffice to give me enough context

  12. Rose Glasses by Saeed+al-Sahaf · · Score: 5, Interesting
    "The reason for the death of the API is probably GNU/Linux"

    This is an Open Source fantasy. It simply isn't true no matter how much you love Linux (and I love Linux a lot). The API is not dead, it only seems that way to the Slashdot crowd who see thing through glasses with a unique prescription. Believe it or not, as of yet, Linux is not sweeping the world like a storm...

    "It's open and documented such that developers feel comfortable using it and feel like they're getting a powerful suite."

    This is only true for Open Source masochists. Building software that does not require the user to have intimate relationships with the OS to install, this is still a large issue that is more or less ignored by all the elitist "gurus" out there.

    "One thing that Microsoft hope doesn't happen is Mono becoming the defacto standard and not the MS framework."

    Honestly. This is not a troll. Is *anyone* actually taking this seriously? Mono is more or less a "If Microsoft can do it, OSS can do it better" type of deal. Mono is a tool in search of a problem. Write once, run anywhere is a fantasy that just does not provide any real world solutions to real world problems. The only reason so many people are using .NET is because Microsoft has made it the default environment, not because they have problems that only .NET can solve.

    --
    "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
  13. Key quotation regarding IE... by GPLDAN · · Score: 5, Insightful

    So the Web user interface is about 80% there, and even without new web browsers we can probably get 95% there. This is Good Enough for most people and it's certainly good enough for developers, who have voted to develop almost every significant new application as a web application.

    Which means, suddenly, Microsoft's API doesn't matter so much. Web applications don't require Windows.

    It's not that Microsoft didn't notice this was happening. Of course they did, and when the implications became clear, they slammed on the brakes. Promising new technologies like HTAs and DHTML were stopped in their tracks. The Internet Explorer team seems to have disappeared; they have been completely missing in action for several years. There's no way Microsoft is going to allow DHTML to get any better than it already is: it's just too dangerous to their core business, the rich client. The big meme at Microsoft these days is: "Microsoft is betting the company on the rich client." You'll see that somewhere in every slide presentation about Longhorn. Joe Beda, from the Avalon team, says that "Avalon, and Longhorn in general, is Microsoft's stake in the ground, saying that we believe power on your desktop, locally sitting there doing cool stuff, is here to stay. We're investing on the desktop, we think it's a good place to be, and we hope we're going to start a wave of excitement..."

    The trouble is: it's too late.


    So, when Slashdot goes on and on about how great Mozilla is (and it is good, I'm not saying it isn't - I really like FireFox 0.9) and laments how Microsoft hasn't done a damn thing with IE since 2001, and how you need the Google toolbar and this and that - remember that quote.

    Microsoft wants to slow DOWN the rate of advancement in the browser. If you buy that, and buy Joel's premise on that, you now should conclude something VERY VERY IMPORTANT.

    Mozilla for Windows may be the SINGLE MOST IMPORTANT OSS project there is. In many ways, it is just as important as developments in Gnome and the linux kernel, disk systems, network protocols, what have you. It's advancements in being able to push rich applications is vital. It's replacement for Active Scripting needs to be secure. Every step it makes pushes another developer that may have gone to use the Windows API or .NET towards building a open web application, and making that application portable. You start stealing from the edges of Window developers. You start picking away at the hordes. That's how you win, you take Microsoft's strongest weapon away - the masses of developers. Where the devs go, users will follow.

  14. Re:Good idea by IrresponsibleUseOfFr · · Score: 5, Insightful

    The fact that Microsoft is breaking backwards compatibility is the exact reason that Joel says they lost the API war.

    Developers, more than anything else want a stable platform to develop for. Microsoft's top priority in the past was to provide a stable platform (stable in the sense that all old-code worked on the new platform). Developers are users too. I would be really pissed off if I upgraded some app and it wasn't able to work with my old data. Why is there a different expectation when I code for an API? Why should I have to rewrite my code because the vendor discovered some better way of doing it? I probably went to a lot of trouble to get that code working in the first place. Make sure it performs well, possibly works around a couple bugs that took me hours or days to figure out, and now the vendor comes along and breaks it and I have to learn some new way of doing it and deal with new, yet undiscovered bugs. fsck that. If it was an app, I would ditch it. If it was a platform and had a choice, I'd ditch that too.

    What platform are people turning to? Joel's answer is the web because HTML/browser represents a very stable platform. I won't reiterate his arguments here. But, I do feel that he has a point. He is a smart guy, and I could see it come to pass. That doesn't necessarily mean it will. Smart people have been wrong before :)

    With Joel's world view, how Linux will make inroads on the corporate desktop is simply by having a good web-browser and being free. Features on the client will become irrelevant.

    All I can say is prediction is hard, especially when you are trying to predict the future.

    --
    Facts are meaningless. You could use facts to prove anything that's even remotely true! -Homer Simpson
  15. Bizzare, yes. Undocumented, no. by autopr0n · · Score: 5, Interesting

    The win32 api, especially from a modern standpoint is just a bizarre creation. Certainly a lot more complex then the stdio, and other Unix libraries. It's grown in strange ways, by using the 'reserved' bits for new things, cramming weird structures in other structures.

    but I've always been able to find documentation on every part of it. Microsoft documentation is very good, and has always been.

    I'm sure there are a lot of bizzare hacks and special modes that are not documented, but if you base your code off the documented APIs, you'll be fine.

    --
    autopr0n is like, down and stuff.
  16. GNU\Linux by 200_success · · Score: 5, Funny
    I've developed software for both GNU\Linux platform as well as microsoft platform(s) and I'll take linux ANY DAY OF THE WEEK!

    What's with the backslash in GNU\Linux? You look suspicious to me, Microsoft boy.

  17. Re:Why it has to die by Bluelive · · Score: 5, Funny

    Debuging into system librarys ? Librarys should be blackboxes, and you should be able to trust them.

  18. Re:Why it has to die by Why2K · · Score: 5, Insightful
    Having to look at the source code is bad for at least two reasons:

    1. It's an excuse for providing poor documentation
    2. Peeking at the source code is a great way to make your application dependant on details of the implementation rather than the interface
  19. It was going just fine until...; by Anonymous Coward · · Score: 5, Interesting

    The first big win was making Visual Basic.NET not backwards-compatible with VB 6.0. This was literally the first time in living memory that when you bought an upgrade to a Microsoft product, your old data (i.e. the code you had written in VB6) could not be imported perfectly and silently. It was the first time a Microsoft upgrade did not respect the work that users did using the previous version of a product.

    Bullcrap! I bought heavily into MS's bull about being able to develop with Word and Excel macros in the Visual Basic scripting language. I wrote several applications for customers that had lotsa finely crafted Word and Excel macros. I bought the first round of Microsoft documents that told me how to do these things. I never bought the second round.

    You know why? Because they changed everything in the shift from Office 6.0 to Office 97! All of a sudden, every API in the Visual Basic scripting language that underlaid Office changed; not just a little, but enough that a whole new shelf of documentation was needed. When I presented my clients with estimates of what was needed to rewrite the macros to make them work under the new Office they quietly asked that I restore Office to the old version. No can do! Microsoft had made that impossible!

    Failing that, my clients insisted that it was my duty to make the macros work with the new version of Office no charge. This would have required rewriting them. Riiiiight! I was gonna do that! In the end, they went back to doing it by hand and I never got another job from them!

    Developers! Developers! Developers! indeed! How many more times do you think I did anything with Microsoft tools?