Strong Duck Type Driven Development
summary
Claim: adding enforceable inter-object contracts to Ruby catches interface breaks earlier and guides fixes. Demonstration shows renaming quack to loud_quack breaks Ruby tests silently but Go compiler surfaces missing methods; a Ruby gem lawyer gem plus RSpec helper contract double enforces contracts at load and in tests, failing immediately with a useful missing-method message. Built examples include duck/brain/visual_cortex code, contract-driven specs, and successful refactors swapping implementations without runtime surprises.
AI-written summary · about
chapters (27)
- 0:00Intro
- 0:11Strong Duck Type Driven Development John Cinnamond
- 1:25How do you build a duck?
- 1:41What is a duck?
- 2:06Let's deconstruct a duck
- 5:13I was required to change the Floaty bit too
- 7:09Let's build a duck
- 9:29How would we write it in Go?
- 12:57DuckBrain knows nothing about Beak
- 13:09Interfaces are no longer intangible
- 18:23The toolchain helps enforce the types
- 18:39We check the type before runtime
- 19:24in 8 years of writing ruby code
- 20:04The compiler hints about how to fix it
- 20:16The object don't know about each other
- 28:21Writing new code is easy
- 28:42We use TDD to make refactoring
- 28:57Contracts make refactoring messages easier
- 29:31Change the messages between objects
- 30:34Replace implementations
- 31:32The tests tell us what to write next
- 31:42We focus on isolated parts of the system
- 32:03messages between parts of the system
- 32:53Noticed accidental coupling...
- 33:09duck typing...
- 33:24Use errors to drive our development
- 33:35Avoids ball-of-mud code
related talks
29mRoasting the Duck - A talk about Ruby and types
30mDucks and monads: wonders of Ruby types
01h 00mBehaviour Driven Development with RSpec
50mWriting Solid Ruby Code
39mThere are no rules in Ruby
39mSteal This Talk: The Best Features Ruby Doesn't Have (Yet)
31mWhat Ruby Developers Can Learn From Go
23mInterfaces Not Required
