您的位置:首页 > 编程语言 > Go语言

how to design a good api and why it matters

2017-04-02 13:53 495 查看
http://www.open-open.com/doc/view/ceee1d75382f4bbc93c8a8a2a98b4e52

Characteristics of a Good API

• Easy to learn

• Easy to use, even without documentation

• Hard to misuse

• Easy to read and maintain code that uses it

• Sufficiently powerful to satisfy requirements

• Easy to extend

• Appropriate to audience

General Principles

API Should Do One Thing and Do it Well

API Should Be As Small As Possible But No Smaller

Implementation Should Not Impact API

Minimize Accessibility of Everything

Names Matter–API is a Little Language

Documentation Matters

Effects of API Design Decisions on Performance are Real and Permanent

API Must Coexist Peacefully with Platform
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: