PIMP Your JS Library or Desgning Non-Shit APIs with JavaScript
summary
Argues that API design wins or loses on concrete choices: shows a tiny DOM builder that maps strings to nodes, a queued connect API that hides readiness and batches calls (used at Twitter), and a dependency system like loadrunner built with prototypal inheritance and duck typing. Calls out real pain points: the DOM event signature, the odd replaceNode ordering, and 28 options in jquery UI draggable. Demonstrates defaults, option hashes, underscored internal methods and overridable selector hooks — and that these approaches actually simplify real libraries.
AI-written summary · about
chapters (22)
- 0:00Intro
- 1:12The Beginning
- 3:03Why did it happen
- 3:52Designers of APIs
- 4:25Predictability
- 5:53How to be predictable
- 7:07Camelcase
- 7:42Polyfill
- 8:59Popular Libraries
- 10:21Problem Domain
- 11:13Example
- 13:54Simplicity
- 15:07The Problem
- 17:34Optional Hashes
- 18:53Function Calls
- 21:44Masking Complexity
- 25:04Simplifying DOM
- 27:05Flexibility
- 31:47Highorder functions
- 33:16Inheritance
- 35:26Duct typing
- 36:51Summary
related talks
42mYour library sucks, and why you should use it
01h 02mJS UX: Writing Code for Humans
38m"Design Patters for Modern JavaScript"
43mDeath to JS Libraries
26mInvisible Code: Building JavaScript Libraries For Non-Technical People
01h 12mJS UX: Writing code for humans
21mAsk not what JavaScript can do for you
27mDesigning Even Larger (JavaScript) Applications
