Meta-programming JRuby for Fun & Profit
Ruby is the revenge of the Smalltalkers. Not since Smalltalk has a language had such powerful meta-programming facilities. While this may seem like a minor feature, it turns out that surgical meta-programming allows solutions to problems that are clearer, more concise, more maintainable, and take orders of magnitudes fewer lines of code.
This session shows one of the reasons that JRuby is the most
powerful mainstream language today: meta-programming. It shows tons of
meta-programming techniques in Ruby, including open classes, the shadow
meta-class, defining methods, method_ & const_missing, dynamically
adding and removing mixins, and more. And each of these comes with an
example that actually makes sense!
Session Topics
- Modules
- Structs
- Freezing
- Messages and Dynamic Invocation
- The Shadow Meta-class
- Code as Objects
- Delegation
- Open Classes
- Aspects
- Missing!
- Const
- Method
- Reflection
- Mixology
About Neal Ford
Neal is Director, Software Architect, and Meme Wrangler at ThoughtWorks, a global IT consultancy with an exclusive focus on end-to-end software development and delivery.
Before joining ThoughtWorks, Neal was the Chief Technology Officer at The DSW Group, Ltd., a nationally recognized training and development firm. Neal has a degree in Computer Science from Georgia State University specializing in languages and compilers and a minor in mathematics specializing in statistical analysis.
He is also the designer and developer of applications, instructional materials, magazine articles, video presentations, and author of 6 books, including the most recent The Productive Programmer. His language proficiencies include Java, C#/.NET, Ruby, Groovy, functional languages, Scheme, Object Pascal, C++, and C. His primary consulting focus is the design and construction of large-scale enterprise applications. Neal has taught on-site classes nationally and internationally to all phases of the military and to many Fortune 500 companies. He is also an internationally acclaimed speaker, having spoken at over 100 developer conferences worldwide, delivering more than 600 talks. If you have an insatiable curiosity about Neal, visit his web site at http://www.nealford.com. He welcomes feedback and can be reached at nford@thoughtworks.com.