“I really thought I had a good grasp on Ruby blocks, but I was mistaken. Thanks for taking the time to dig into blocks and iterators at this level of detail and thus saving me the time of exploring and uncovering these techniques and patterns on my own. I am NOW quite confident about my understanding of blocks, and mastery over them. I suddenly feel newly empowered!” — Thom Parkin
I love that Thom uses the word “empowered” to describe how he felt after our Mastering Ruby Blocks & Iterators course. That's exactly how I felt when I learned how to really use blocks in my own code. I'm not talking about how to write a block. Sure, understanding the basic block syntax and style is important and it's where we start in our course (free video). But using blocks effectively is about so much more than curly braces, vertical bars, and syntactic sugar.
The real sweet spot is when you start designing your own code to take advantage of the power of blocks. Indeed, well-designed Ruby code uses blocks to elegantly solve common and recurring problems, including:
- Writing custom iterators
- Executing “around” code
- Toggling code on and off
- Initializing objects with a block
- Managing resources consistently
Our Mastering Ruby Blocks & Iterators course is the course I wish I would have had in my early days of Ruby (10 years ago!). Instead it took me many years of seeing blocks used by other developers in a variety of scenarios before I began to recognize these common design patterns. But once I internalized them, I felt so much more productive! Now whenever I write Ruby code I'm thinking, “Could I improve this code with a block?”
To help you quickly see and internalize the design patterns for yourself, in this course we explore over 40 different code examples. Ultimately, it's understanding when and where to use blocks effectively in your own code that makes you an empowered Ruby developer.
We'd love to have you join us in the Studio and learn how to master Ruby blocks, the Pragmatic way!