TheTime Posted October 11, 2012 Report Posted October 11, 2012 At some point or another, you will find yourself writing JavaScript code that exceeds the couple of lines from a jQuery plugin. Your code will do a whole lot of things; it will (ideally) be used by many people who will approach your code differently. They have different needs, knowledge and expectations.This article covers the most important things that you will need to consider before and while writing your own utilities and libraries. We’ll focus on how to make your code accessible to other developers. A couple of topics will be touching upon jQuery for demonstration, yet this article is neither about jQuery nor about writing plugins for it.Peter Drucker once said: “The computer is a moron.” Don’t write code for morons, write for humans! Let’s dive into designing the APIs that developers will love using.TABLE OF CONTENTSFluent InterfaceConsistencyHandling ArgumentsExtensibilityHooksGenerating AccessorsThe Reference HorrorThe Continuation ProblemHandling ErrorsGoing AsynchronousDebugging Fluent InterfacesDocumenting APIsConclusionSursa Quote