

The websockets api spec doesn't like you - jond3k
http://jond3k.blogspot.com/2011/10/websocket-api-spec-doesnt-like-you.html

======
jgraham
If you're implementing a websocket client outside a browser, there is no need
for you to follow that API spec. Feel free to invent any API that works well
for the language that you're targeting.

We have spent too much time in the past going down the "one API that can be
implemented in any language" design path in the web space and it hasn't worked
out well. The DOM is a pretty egregious example of this; parts of it are
clearly designed to work in any language as long as it can look sufficiently
like java. The result is it sucks everywhere (including java, I expect,
although I can't say I have tried). It's not a coincidence that python
programmers now use ElementTree rather than DOM, or that javascript
programmers now use jQuery; these libraries have APIs written to the
language's strengths.

Today when we invent new web APIs we try to make them feel natural in
javascript because that's the language that web browsers run. That's hard
enough without simultaneously trying to make them good fits for PHP, Haskell
and Clojure.

~~~
jond3k
Maybe, or perhaps it's just been done badly before.

ZeroMQ's bindings are an example of it done well. I find the API is almost
identical if I switch between Python, PHP and Erlang and I never feel like any
of these implementations feel out of place in their language.

I agree with your final point.

