I often have to design client APIs for use by other programmers. The language can vary from Ruby, Java, Erlang and Javascript (Mootools). Does anyone have any tips on creating a very usable API. And yes, this "is" a very subjective question and I am asking so that I can make my APIs easier to use by others.
6 Answers
watch this: http://video.google.com/videoplay?docid=-3733345136856180693#
To add details this is a video of lecture given by Josh Bloch who's a senior java bod at Google. It's excellent if you want an overview on issues to consider when making an API

- 487
- 2
- 10
I strongly recommend to follow Joshua Bloch's advice: Joshua Bloch - How to Design a Good API and Why it Matters. It's available in PDF and Video.

- 7,169
- 1
- 44
- 45

- 1,082,665
- 372
- 3,610
- 3,555
A few ideas:
- Make your method names very descriptive
- Use documentation to clearly indicate parameters and return values
- Follow YAGNI and KISS
- Nothing helps like code examples... lots of them covering lots of use cases

- 34,502
- 9
- 78
- 118
If you have are interested in some non-free alternatives, then the following book would be a good recommendation:
Practical API Design: Confessions of a Java Framework Architect by Jaroslav Tulach

- 6,318
- 23
- 21
If one of your primary goals is to make an usable API, or, in other words, to provide good developer experience, then maybe you should review this list of resources (api usability & developer experience resources): http://www.apiusabilitytesting.com/resources/

- 308
- 2
- 10