Settings

Theme

Ask HN: How do I write good API client libraries?

2 points by jnankin 11 years ago · 0 comments · 1 min read


I'm writing some new API client libraries in a variety of languages (PHP, Java, Ruby, C#, JS, Python) for an API.

Is there a list of best practices or a good resource for doing this? Both in general, and language specific?

Here are somethings I'd expect to see in such a resource: - How to handle instantiation of the library (static functions with static API credentials vs new instances of the library with instance variables for API credentials) - How to pass binary files - Using required arguments for required parameters of an API operation vs a hash or dictionary - How to name function calls - How to structure code/classes in relation to the API's design - What good client libraries should return or throw as an exception ... and so on

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection