Writing Modular Ruby Code: Lessons Learned from Rails 3
summary
Argues against premature modularity and shows concrete Rails 3 changes: moves routing off globals so multiple routers and rackapps URL helpers work, converts class-level flags into per-instance perform_caching so tests and thread safety improve, replaces path-based templates with storage-agnostic resolvers and a lookup_context to enable caching and SQL or DB templates, cites a surprising 7% compliance stat and reports the desert plugin shrinking from thousands to 50 lines, demonstrating these changes actually work.
AI-written summary · about
chapters (11)
- 0:00Start
- 16:02Be suspicious of any use of Constant.foo
- 18:05Turn off caching?
- 20:46Stop worrying about allocations
- 21:11Object allocation is essentially free
- 24:251. Files, files everywhere!
- 26:50Logic to make path is everywhere
- 35:34Again, tests are the canary in the coal mine
- 36:36Use Modules
- 38:45Use ActiveSupport:: Concern
- 40:27Questions?
related talks
01h 09mRails 3 ...and the real secret to high productivity
48mFrom Rails to Rack: Making Rails 3 a Better Ruby Citizen
46mClosing Keynote
01h 12mRuby Best Practice Patterns
17mDesigning software that maximizes developer productivity
45mHow Programming in Other Languages Made my Ruby Code Better
36mOpening up to change
32mComponent-based Architectures in Ruby and Rails
