yazz.com
yazz.com

Reputation: 58826

What is the best way to design a client API?

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.

Upvotes: 0

Views: 1173

Answers (6)

BalusC
BalusC

Reputation: 1109875

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.

Upvotes: 1

DenisL
DenisL

Reputation: 338

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/

Upvotes: 1

Waleed Al-Balooshi
Waleed Al-Balooshi

Reputation: 6406

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

Upvotes: 2

Joel
Joel

Reputation: 30166

I recommend reading the following from the Trolltech/Nokia guys:

The Little Manual of API Design

Upvotes: 1

Dave Swersky
Dave Swersky

Reputation: 34820

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

Upvotes: 1

dangerstat
dangerstat

Reputation: 477

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

Upvotes: 1

Related Questions