Metaprogramming for generalists
summary
Claim: metaprogramming’s power is that it translates unknowns into code, letting libraries speak the domain language rather than forcing apps to call generic setters. Demonstration: knockout example removes define_method/instance_eval and makes attribute names visible; restore metaprogramming and the abstraction becomes invisible again. Built a reusable equaliser using define_method and send to generate ==, hash and inspect for Address and GPSLocation; this pattern becomes the dry-equaliser gem, showing the approach works.
AI-written summary · about
chapters (9)
- 0:00Start
- 5:05Points about Me
- 5:53Generalist Meta Programming
- 10:10Why Is Meta Programming So Prevalent in Our Libraries
- 13:19Knockout
- 24:53The Best Ways To Write Flexible Software Is To Write Generic Software
- 29:17Method Arguments
- 30:10Create a Gem
- 32:39Dry Equalizer
related talks
18mMetaprogramming: Unraveling the Magic
33mMetaprogramming Isn't Real, It Can't Hurt You
26mMeta-programming for Dummies
25mIn Defense of Ruby Metaprogramming
31mSeeing Metaprogramming and Lambda Function Patterns in Ruby
38mMy Meta Moments
36mMetaprogramming? Not good enough!
28mDiving into Dynamic: Demystefying Metaprogrammaing with Ruby
