Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Metaprogramming Ruby: Program Like the Ruby Pros 1st Edition
There is a newer edition of this item:
$298.99
(30)
Only 1 left in stock - order soon.
Everyone in the Ruby world seems to be talking about metaprogramming--how you can use it to remove duplication in your code and write elegant, beautiful programs. Now you can get in on the action as well.
This book describes metaprogramming as an essential component of Ruby. Once you understand the principles of Ruby, including the object model, scopes, and eigenclasses, you're on your way to applying metaprogramming both in your daily work and in your fun, after-hours projects.
Learning metaprogramming doesn't have to be difficult or boring. By taking you on a Monday-through-Friday workweek adventure with a pair of programmers, Paolo Perrotta helps make mastering the art of metaprogramming both straightforward and entertaining.
The book is packed with:
- Pragmatic examples of metaprogramming in action, many of which come straight from popular libraries or frameworks, such as Rails.
- Programming challenges that let you experiment and play with some of the most fun, "out-there" metaprogramming concepts.
- Metaprogramming spells--34 practical recipes and idioms that you can study and apply right now, to write code that is sure to impress.
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.
- ISBN-101934356476
- ISBN-13978-1934356470
- Edition1st
- PublisherPragmatic Bookshelf
- Publication dateFebruary 25, 2010
- LanguageEnglish
- Dimensions7.5 x 1 x 9.25 inches
- Print length296 pages
What other items do customers buy after viewing this item?
Editorial Reviews
About the Author
Paolo Perrotta has more than ten years of experience as a developer and writer. He worked for domains ranging from embedded to enterprise software, computer games, and web applications. These days, Paolo coaches agile teams for Yoox, a large Internet fashion shop, and teaches Java to developers throughout Europe. He lives in Bologna, Italy, with his girlfriend and a cat. He loves Ruby.
Product details
- Publisher : Pragmatic Bookshelf; 1st edition (February 25, 2010)
- Language : English
- Paperback : 296 pages
- ISBN-10 : 1934356476
- ISBN-13 : 978-1934356470
- Item Weight : 1.35 pounds
- Dimensions : 7.5 x 1 x 9.25 inches
- Best Sellers Rank: #1,576,256 in Books (See Top 100 in Books)
- #119 in Ruby Programming
- #908 in Object-Oriented Design
- #3,262 in Internet & Telecommunications
- Customer Reviews:
About the author

Paolo Perrotta speaks and writes about software development. He worked as a developer all around the world, in domains that range from embedded to enterprise software, computer games, and web applications. He is the author of Metaprogramming Ruby, Programming Machine Learning, and the Git courses on Pluralsight. He has a basecamp in Bologna, Italy.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
i) Highlights the conceptual differences between Ruby and other currently popular languages
ii) Shows how those conceptual differences are expressed in programming constructs by walking the reader through a number of small but realistic example problems
iii) Reviews internal details of a number of pieces of real-world software (most notably Rails) to show how the authors of these packages use the techniques he describes to solve their problems
iv) Provides a number of helpful and applicable guidelines on how to 'think in Ruby'
v) Generates a GoF style catalog of implementation patterns
vi) Skewers the notion that 'metaprogramming' is any different than regular programming
After finishing this book I have a real appreciation of the techniques the author describes, and how they can be used to write flexible, powerful, and maintainable software. Before reading this book I was aware of a number of these techniques, but I didn't necessarily understand how they could be effectively used to solve real problems. Now I do. The book truly covers how to think in Ruby - how to naturally solve problems in Ruby, as opposed to adapting techniques commonly used in languages from the C/C++/Java lineage.
The one major criticism I had of Metaprogramming Ruby was the 'fanboy' tone that permeates a lot of the text. Frequently the author seems more interested in getting you to agree with him that Ruby is great than in conveying the concepts being discussed. There are a lot of gratuitous slams of other languages (especially Java) that were frankly unnecessary and distracted from the book. Had the tone of those comparisons been a little more highbrow and a little less schoolyard, this would have been a better book.
Overall rating: 4.5 stars
The content of the book is excellent! The techniques described are very useful, and the author uses mostly good examples to illustrate the use of the different recipes. As a side-note, I also recommend the screencast series by PragProg.com about Metaprogramming Ruby. The book has three chapters which cover how Metaprogramming is used in the Rails framework, which is also very useful.
So far, so good, BUT......
The downside of this book is the writing style -- I'm quoting from orangekay's review here on Amazon:
[...] it's written in a really annoying tone that attempts to present said information as a story.
That story is very boring, gets old after the first paragraph, and makes it very difficult to find
the code you want amidst the sea of useless prose.
I can only second that statement! It is extremely annoying to read this book because of the stupid side-story, and it is very hard to find the relevant concepts later. The names of the concepts/recipes discussed in the book are mostly badly chosen, which is both annoying and confusing later.
I'm wondering why this style was chosen.. to add pages? It's so annoying that I feel tempted to take a big fat black marker and x-out all this junk from the silly side-story. If I had this in an editable electronic form, I would re-format the content!
I wish the author would take these comments to heart, and in the next version of the book, would follow a standard format, e.g. a "Cook-Book" approach, to discuss the techniques described in this book -- without a side-story!
If you want to learn in detail how Metaprogramming Ruby works, by all means: buy this book, it is very useful!
I would give this book 4 stars, but because of the obnoxious writing style I rate it as 3 stars.
The author starts by letting you know the ever-important "whys" around the language's origin & design; many of which I didn't know despite programming in Ruby for many years. Building on these basics, the author presents a coherent view of how to use the unique features of the language to become much more effective at software development. He extends this with example after example of how the world's best have done exactly that in Ruby's popular frameworks & gems -- including the core components of Ruby on Rails and ActiveRecord.
A few reviews I saw before reading the book mentioned the story-based narrative was distracting. While I can completely see this point of view, and the author is a developer not a novelist for sure, the story did serve as a solid tool to connect the various topics.
Highly, highly recommended.
Top reviews from other countries
The book is clear, it has a funny way of introducing things and the whole "lets tell a story about this" kind of approach just makes it seem like I'm not reading a technical book but a story book.
This book helped me understand how many ruby gems do things, especially ActiveRecord, and helped me be a better programmer.
Now I'm so much into the metaprogramming concept that any language that doesn't support it, I'm not interested!
Diese Buch hat mir enorm geholfen, alle Ruby-spezifischen Konzepte wie Singleton Classes, Scopes, Klassenobjekte, method_missing, method lookup, include/extend, ancestor chain, class_eval/instance_eval etc wirklich zu verstehen und sicher anwenden zu können.
Im hinteren Teil gibts es dazu eine handliche Referenz, die typische Idiome und Patterns erklärt (der Autor nennt sie "Spells"), die man in Ruby-Code häufig antrifft und die die eigene Arbeit erleichtern.
Wer Ruby wirklich verstehen will, sollte dieses Buch unbedingt anschauen und sich nicht vom Titel abschrecken lassen.
Das Kindle-Buch "Metaprogramming Ruby" hat für mich diese große Lücke geschlossen. Auch wenn man in der englischen Sprache nicht ganz zu Hause ist, ist dieses Buch - umrahmt von einer kleinen Alltagsgeschichte aus dem Büro (Workshop) - sehr gut zu lesen.
Im Rahmen eines Workshops in Form von Aufgaben werden hier die verschiedensten Methoden/Klassen/Objekte und die Funktionsweise innerhalb von Ruby dargestellt.
Auf jeden Fall macht es Lust auf mehr... Also von meiner Seite eine klare Kaufempfehlung!



