Saturday, August 25, 2007

Best practices in library design

John Resig presented some very interesting thoughts on a JavaScript library design based on his experiences with jQuery and FUEL.

John advises how to write a solid API (those ideas seem to be useful not only for JavaScript developers):

  • perform universal actions (like CRUD)

  • fear adding methods (defer to extensibility, less but more powerful methods)

  • constantly review and remove unused code

  • provide an upgrade path for deprecated APIs (plugins / extensions supporting obsolete methods)

  • reduce to a common root (by finding common usage patterns)

  • care about consistency (naming, arguments order)



Here is the presentation video:



Presentation slides are also available at SlideShare:

No comments: