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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Secrets to Great API Design (2019)

96 点作者 spencerwgreene大约 3 年前

7 条评论

voicedYoda大约 3 年前
The article brings up interesting points, but reads like I'm blasting through a red bull ad. (Zing Zang Zoom!) API development is super important, and KIS principles should apply, but i felt this post was more marketing and less functional advice.
评论 #30670962 未加载
评论 #30671871 未加载
评论 #30668188 未加载
politelemon大约 3 年前
&gt; It may be better to add GraphQL APIs.<p>Don&#x27;t add GraphQL without understanding what you&#x27;re getting into. I wouldn&#x27;t use it in the same &#x27;latest frictionless&#x27; context that the article mentions.
评论 #30671087 未加载
tabtab大约 3 年前
The best API&#x27;s fit how users actually use them. I&#x27;m not sure there is a one-design-fits-all. One has to study to see what&#x27;s done the most often and optimize around those, yet still allow flexibility for the times that deviate from common usage patterns. Make the common stuff short and easy, but the uncommon stuff possible and clear-cut. It may take a couple of iterations in actual use to tune it.<p>I also like &quot;self-eating dogfood&quot; in that the shortcuts are defined using existing &quot;long-cuts&quot; and the API user can study, learn from, and change and&#x2F;or write their own shortcuts using the long-cuts.<p>C#&#x27;s optional-named-parameters (ONP) are ideal for such. I don&#x27;t why Java and JavaScript don&#x27;t implement ONP&#x27;s. The alternatives, such as object literals and method overloading, are just too clunky. Once you tasted ONP&#x27;s you don&#x27;t wanna go back.
password4321大约 3 年前
2 days earlier, 200 more comments:<p>How to Design Better APIs | <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30647784" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30647784</a>
dbsmith83大约 3 年前
&gt; Learn how to make your API stand out from the <i>rest</i> ...<p>I see what did there
mkoubaa大约 3 年前
I&#x27;m not sure how I feel about the term API being used unqualified to refer exclusively to SaaS remote APIs. API design is really important for any kind of library or module.
jack335大约 3 年前
great article!<p>TLDR;<p>1. Shorten Time to Value<p>2. Treat Your Docs Like the Home Page of Your Website<p>3. Make Abstractions Consistent<p>4. Future-Proof Your API<p>## Documentation<p>Sharing documentation via tools like postman or insomnia is a real game changer IMO