Affordance in Programming Languages
summary
Claim: programming languages offer concrete affordances that enable and constrain solutions. Demonstrates applying Smalltalk ideas to Ruby: named constructors (Point.x_y and Point.polar), passing an if_none callable to find, and emulating C++ RAII/deterministic destruction with a SafeResource.acquire block so resources are released reliably. Shows an extensible ImageReader using subclass iteration via the inherited hook that auto-registers readers. Each pattern is implemented in code and shown to work.
AI-written summary · about
chapters (8)
- 0:00Start
- 2:41Affordances and Software
- 6:31Named Constructors
- 11:44Example Cleaning Up After Yourself
- 14:46Resource Acquisition is Initialization Acquire resources in the constructor Release them in the destructor
- 15:54Affordance Deterministic Destructors
- 21:05Subclass Iteration
- 24:51Don't go too far








