March 7th, 2006

device

Choose a paradigm and stick to it, dammit!

Another sin to lay at Microsoft's feet: I'm currently working on doing some seriously down-and-dirty programming inside of IE. (Yes, I know, but there's a lot of magic we want to do that simply can't be done at the Javascript level.) In many ways, it's a delightfully complete system -- when working in C++, you can make IE sit up and do almost any sorts of tricks.

But: rarely in my life have I seen anything so inconsistent. If I have to pass a string into a method, it's sometimes a BSTR, and sometimes a VARIANT. If I need to pass a number, it's sometimes long, sometimes a VARIANT, and sometimes a VARIANT that wraps a BSTR that represents the number. Someone clearly wrote a standard for these APIs at some point, because they're consistent in *some* ways, but there is no obvious rhyme or reason to the parameters at all.

(And we won't even get into the fact that every object implements something like eight different interfaces, so I'm QI'ing all over the place...)