tags:

views:

44

answers:

5

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.

+1  A: 

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

dangerstat
Your link didn't work, it says the video is unavailable
Zubair
+1  A: 

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.

BalusC
Which is exactly what my posts points too?
dangerstat
Didn't see it. Great minds think alike :)
BalusC
+1  A: 

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
Dave Swersky
+1  A: 

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

The Little Manual of API Design

Joel
Ive started reading it. very nice!
Zubair
A: 

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

Waleed Al-Balooshi