TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The websockets api spec doesn't like you

5 点作者 jond3k超过 13 年前

1 comment

jgraham超过 13 年前
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.<p>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.<p>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.
评论 #3090598 未加载