API Design is Hard
summary
Built Jedi autocompletion (≈2,000 stars on GitHub) as a case study, showing specific mistakes and fixes: prefer simple return types over custom objects, avoid exposing internals by using use underscores for non-public and Jedi autocompletion (≈2,000 stars) as an example of a modular parser you can rip out, favor functions over properties when you might add parameters later, emit deprecation warnings via warnings.warn and use semantic versioning, expect maintenance (roughly 4–5 hours/week) and poor refactoring tool support.
AI-written summary · about
chapters (15)
- 0:00Introduction and background
- 3:24Why API design matters
- 6:41Bad API examples
- 9:16Consistency in API design
- 13:40Brainstorming your API
- 17:01Performance vs API design
- 18:29Conservative API decisions
- 20:05Underscore conventions in Python
- 23:05Naming conventions and clarity
- 25:38Named arguments in Python
- 27:25Properties in API design
- 29:59API transitions and versioning
- 35:23Internal APIs and long-term design
- 38:01Conclusion and advice
- 39:39Q&A session
