Refinements - the Worst Feature You Ever Loved
summary
Explains that Ruby 2 refinements aim to provide local monkey patches by scoping changes with the using keyword, but only lexically, not dynamically; shows that lexically scoped refinements call super into the original implementation, avoid the global performance and security penalties of dynamic scope, and expose awkward corner cases (IRB eval, needing using in every file), which is why big libraries like Rails and RSpec largely don’t adopt them.
AI-written summary · about
chapters (10)
- 0:00Start
- 2:54domain specific languages
- 4:22method wrappers
- 6:24defining a refinement
- 6:55using a refinement
- 10:32dynamic scope
- 19:15dynamically scoped refinements: the bad
- 21:05lexical scope
- 24:45convenience methods
- 26:38refinements today: the good
related talks
30mRefinements - the Worst Feature You Ever Loved
38mRefinements - The Worst Feature You Ever Loved
42mWhy is nobody using Refinements?
53mRuby 2 in Ruby on Rails
47mClassboxes, nested methods, and real private methods
41mTen Things I Hate About Ruby
34mHijacking Ruby Syntax in Ruby
32mruby best practice patterns
