Just Because You Can, Doesn't Mean You Should
summary
Advocates concrete rules: avoid type-checking — accept iterables not just lists; provide explicit constructors like from_iterable or from_adjacencies so callers never guess (about a third of people guess wrong). Separate protocol assembly from transport (e.g. statsd message builder vs socket sender), accept file-like objects instead of file paths, use path objects for real files, and expose a convenience layer for headers/cookies rather than hiding underlying ordered/duplicate semantics.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:15Design philosophy
- 3:25Pitfalls of type checking
- 5:39Avoid ambiguous dispatch
- 16:07Resource management
- 21:14Separating network concerns
- 26:44Convenience layers
- 29:44Attribute access risks
- 34:19Q&A and conclusion
related talks
01h 18mAPI design: Lessons Learned
51mSimplicity: Not Just for Beginners
23mReadability Counts
01h 02mHow to Hide C++ Implementation Details
49mScala best practices I wish someone'd told me about
33mThe Catcher in the Code
21mAbstraction for students of all the things
57mCore Software Design Principles for Programmers
