Podcast: Play in new window | Download (Duration: 1:09:24 — 95.3MB)
Panelists
- Avdi Grimm (twitter github blog book)
- Charles Max Wood (twitter github Teach Me To Code)
- David Brady (blog twitter github ADDcasts)
- Gregory Brown (blog twitter github Ruby Mendicant University)
- James Edward Gray (blog twitter github)
Discussed in this episode
- What is metaprogramming
- AST
- Ripper
- method_missing
- send
- super
- defined?(super)
- alias method chain
- rdoc
- rspec
Guidelines
- Aliasing/Redifining methods (generally wrong)
- Dynamic Module generation (Generally right)
- understand Ruby’s method call lookup
- understand modules (extend and include)
- Calling super is usually a good idea
- If you’re going to monkey patch, make sure that the method isn’t already there
- Make your changes easy to find
- class_eval def vs define_method
- Convenience constructors – In a medium sized project, you should not do this more than 3 times.
Picks
- vagrant (Avdi)
- Best of Ruby Quiz
(Avdi)
- anti-pick: TeamViewer (David)
- Let Dave know if you have a great tool for sharing screens and collaborating over the web.
- gnu screen (Greg)
- irssi (Greg)
- square foot gardening(Greg)
- find/be a mentor (James)
- George R. R. Martin’s A Song of Ice and Fire
(James)
- #rmu channel on freenode for mentoring (Greg/James)
- Rails 3.1 hackfest (Josh)
- escapepod.org (Josh)
- Cassandra: The Definitive Guide
- jQuery-UI



{ 8 comments… read them below or add one }
Have you tried Screenr Business? http://business.screenr.com/pricing/
Nevermind, I forgot that Screenr is a screencasting tool and not a screen sharing tool!
Greg should refrain himself from interrupting people that much. It was a little disturbing, honestly.
I’ve got some questions:
What is dynamic module generation? I can’t find any information on the interwebs. I’ll probably have to listen to this episode after I learn about it, I got a little lost without proper context.
Are convenience constructors the sort of thing that returns an object of itself? i.e. a ‘create_something_awesome’ class method initializes an object of the class itself and then applies a bunch of things to it? Please let me know if this is the case. I usually do not take this approach because an extra .new never hurts that much.
All and all, awesome podcast as always. I’d love to hear a metaprogramming part 2, it sounded like you guys had a lot more to discuss.
Don’t blame Greg too much. We can’t see each other when we talk, so it’s hard to know who should talk next.
Dynamic module generation refers to code that uses something like Module.new() and/or the eval() methods to build up a construct on the fly, as needed. Here’s an example using Class.new() which might give you the idea: http://blog.grayproductions.net/articles/summoning_error_classes_as_needed
I believe your description of a convenience constructor is accurate, though I don’t think it was me who used the term.
Dynamic Module generation – can you provide more info and/or a link?
Great show as always, a metaprogramming 2 does indeed sound like it would be useful.
“Convenience constructors – In a medium sized project, you should not do this more than 3 times.”
Was wondering if you could provide a bit more info/ context on this one?
Pedro,
I can see what you’re saying. Sorry about that. This is a topic I get all fired up about but at the same time the call was full of people smarter than me that I should have given a lot more space. It wasn’t intentional, but I’ll keep it in mind for future sessions.
Full meta-programming would be nice. It would put Ruby on par with Scheme and Smalltalk. One could for example implement optimisers and just-in-time compilers in Ruby without having to modify the VM.
{ 1 trackback }