Write powerful Ruby code that is easy to maintain and change. With metaprogramming, you can produce elegant, clean, and beautiful programs. Once the domain of expert Rubyists, metaprogramming is now accessible to programmers of all levels. This thoroughly revised and updated second edition of the bestselling Metaprogramming Ruby explains metaprogramming in a down-to-earth style and arms you with a practical toolbox that will help you write your best Ruby code ever.
Dig under the surface and explore Ruby's most advanced a collection of techniques and tricks known as metaprogramming. In this book, you'll learn metaprogramming as an essential component of Ruby and discover the deep, non-obvious details of the language. Once you understand the tenets of Ruby, including the object model, scopes, and singleton classes, you're on your way to applying metaprogramming both in your daily work assignments and in your fun, after-hours projects.
Metaprogramming Ruby, Second Edition makes mastering the language enjoyable. The book is packed
Pragmatic examples of metaprogramming in action, many of which come straight from real-life gems such as Rails.
Programming challenges that let you experiment and play with some of the most out-there metaprogramming concepts.
Metaprogramming "spells"--33 practical recipes and idioms that you can study and apply right now, to write code that is sure to impress.
This completely revised new edition covers the new features in Ruby 2.0 and 2.1, and contains code from the latest Ruby libraries, including Rails 4. Most examples are new, "from the wild," with more recent libraries. And the book reflects current ideas of when and how much metaprogramming you should use.
Whether you're a Ruby apprentice on the path to mastering the language or a Ruby wiz in search of new tips, this book is for you.
Good book that was well-written and enjoyable. Lots of programming books can be a chore / slog to read since they feel too informative. I particularly enjoyed the code examples from real libraries; it's always interesting to read other code in real-world examples.
omg I finally finished a non-fiction book, and a technical one, and this one in particular, at that! This book is excellent, really, but until I had learned some of the material piecemeal from my job and from watching talks, I couldn't get myself past the first couple chapters. I think also I had to come to accept that having to take breaks (and also possibly naps...) when reading programming books is just a thing for me.
Anyway, the explanations and examples are very good. I think I may finally understand the Ruby object model and method lookup process!!! I like that there's enough of a behind-the-scenes peek at why certain things are the way they are in Ruby, without bogging you down with excruciating detail. The framing narrative of pairing with expert Rubyist "Bill" is a little tedious at times, but he does mix in female pronouns here and there, so don't let that bug you too much.
I'm not sure how useful this information is necessarily for a straight up Rails developer, but if you want to understand Ruby the language better, this is great.
Dont make a mistake of just reading this book without trying out stuff on your own. A lot of topics went over my head and although I mark this book as read, I will be coming back to it, few pages at a time with my IDE open.
I am partially repeating the same story from another book I just reviewed from 2015's reads. I wrote Ruby in a forex trading company. What I also omitted is that I worked for two companies, one in the first half of 2015 and the other in the second. Both had lots of experienced Ruby engineers around me. I wanted to learn and understand it because I was curious about knowledge and had a passion for debate at the time.
Metaprogramming is a hot topic in Ruby and makes everyone feel smart when they meta-program. Well, for the sake of knowing and practicing this when it was the smart thing to do, yes, the book was a good resource. It was straight to the point, with a good format of code snippets, quizzes, and quiz solutions. As simple as you'd expect.
At that time and still to this date, I don't recommend anyone put their make-pretend smartness into code that their colleagues have to read. If you're truly smart, you're going to write idiomatic code. :)
Between this and POODR, I have yet to find better books on Ruby. The Rails section was more of an object lesson for me, as it's very deep into the weeds with a particular framework.
Outstanding way to describe metaprogramming and what are the best ways to achieve good programming skills regarding this technique. This one is a must to have, for all ruby developers.
You have being programming in Ruby for a while and you need a book to step up your game. This introduces multiple meta programming concepts partly through a story of a mentor and mentoree, multiple examples and explains when you should use each techniques. It uses both code and pictures to describe the examples. Without a doubt one of my favourite Ruby books and I have most of them! Excellent work Paolo.
Great introduction to the world of metaprogramming. The author found a way to explain such a complex topic in fun and easy manner. A number of real world code examples and a few historical insights to Rails codebase give a pretty good representation on how to (and how not to) solve typical problems with metaprogramming. Definitely a good read.
After reading this book, I could see the real power the Ruby lang has to offer. Metaprogramming is, by far, the most important concept for Ruby developers. I would recommend this book to anyone who has a good ruby experience and is seeking a good resource to take the knowledge to the next level.