Writing Code for Humans
summary
Code acts as a user interface: APIs must make the common case fast and the rare case possible. Concrete examples: the ancient compareDocumentPosition bitmask forces bitwise checks where a simple contains would do; svg.cx.baseVal.value shows an API that buries simple reads under layers; canvas getContext silently ignores conflicting options; URL() oddly requires a base for relative URLs. Design wins include shortcuts, sensible defaults, and using option objects; lessons come from thousands of PR reviews and W3C TAG reviews (11 members) feeding changes that actually improve usability.
AI-written summary · about
chapters (16)
- 0:00Code is for humans
- 1:33API usability matters
- 4:38Documentation is not enough
- 6:41The role of the W3C TAG
- 10:55Start with user needs
- 14:32Make simple things easy
- 18:24Designing for power
- 21:26The ease-of-use curve
- 24:43Avoid unnecessary errors
- 28:14Single source of truth
- 30:58Consistency is key
- 35:05When to break consistency
- 38:13Sensible defaults
- 42:26Avoid argument traps
- 46:16Robustness and flexibility
- 49:54Empathy in design








