Investigative Metaprogramming
summary
Sees a concrete claim: an obscure Rails error that would take weeks becomes solvable in hours by inserting runtime instrumentation. Notices the actual bug is a frozen hash and the thing that matters is where it freezes not the stacktrace. Uses tracepoint API and prepend to override methods to record events, instruments the freeze method and toggles conditional binding.pry breakpoints, stores results in a temp initializer or global, and pinpoints the problematic association change.
AI-written summary · about
chapters (33)
- 0:00Intro
- 1:31The Problem
- 2:02The Failed Tests
- 4:08Defining Metaprogramming
- 4:38Agenda
- 5:26Definitions
- 6:37Send with variables
- 7:00Modify academic definition
- 7:24If vs send
- 8:20Ruby interpreter
- 9:17Class macros
- 10:34Define method
- 11:09Definition
- 11:51Program Structure
- 12:23Pragmatics
- 14:09Tools
- 14:47Code Bases
- 15:27The Correct Tool
- 16:56Classics
- 18:21Methods
- 19:28Expanding your understanding
- 20:19Recording
- 20:32Tracepoint
- 21:21KalamaTree
- 21:51Where to put it
- 22:28Reviewing
- 23:28Solving real problems
- 24:16Investigative metaprogramming
- 24:55Reviewing problems
- 25:31Recording problems
- 25:50Reflection problems
- 26:06Stack trace
- 28:06About Betsy
related talks
37mWhat’s happening in your Rails app? Introduction to Introspection features of Ruby
38mPractical Debugging
43mThe joy of Ruby debugging - Pry universe
18mMetaprogramming: Unraveling the Magic
28mTracing your way through Ruby
38mMy Meta Moments
34mHijacking Ruby Syntax in Ruby
38mDispelling the dark magic: Inside a Ruby debugger
