Ian Hickson: > Consistency is good when it makes sense. However, I don't think XHR is a > good parallel here. XHR has all kinds of additional complexities, for > example it lets you get a string, whereas here string vs binary is handled > at the protocol level and so can't ever be confused. > > However, if we want consistency here anyway, then I'd suggest we change > XHR to use the actual type values just like WebSockets. It would IMHO lead > to much cleaner code.
The difference would just be specifying `"ArrayBuffer"` vs `ArrayBuffer`, right? I think the difference in cleanliness is minimal. Using strings as enumeration values is quite common in JS, but I don’t think I’ve seen this idiom of using interface objects before. -- Cameron McCormack ≝ http://mcc.id.au/