How do you write truly elegant code with Ruby? Ruby Best Practices is for programmers who want to use Ruby as experienced Rubyists do. Written by the developer of the Ruby project Prawn, this concise book explains how to design beautiful APIs and domain-specific languages with Ruby, as well as how to work with functional programming ideas and techniques that can simplify your code and make you more productive. You'll learn how to write code that's readable, expressive, and much more.
Ruby Best Practices will help you:
Understand the secret powers unlocked by Ruby's code blocks Learn how to bend Ruby code without breaking it, such as mixing in modules on the fly Discover the ins and outs of testing and debugging, and how to design for testability Learn to write faster code by keeping things simple Develop strategies for text processing and file management, including regular expressions Understand how and why things can go wrong Reduce cultural barriers by leveraging Ruby's multilingual capabilities This book also offers you comprehensive chapters on driving code through tests, designing APIs, and project maintenance. Learn how to make the most of this rich, beautiful language with Ruby Best Practices.
Provides suggestions for writing clean, bug-free, and efficient code. Unfortunately, the book itself isn't so clean, bug-free, and efficient. I can overlook the typos. Some of the suggestions are useful, but most of it is pretty basic stuff you'll find in other Ruby books. The author likes to dump chunks of code from his own open source projects (he couldn't shut up about Prawn) that make your head hurt, and then not explain much of it. It's hard to make Ruby boring, but this book pulled it off.
If you have already coded in Ruby for a while, you definitely should check out "Ruby Best Practices". As the title suggests this is not about learning Ruby, it's about getting the most out of the language, for yourself as well as for potential collaborators and colleagues. No matter how long you've been doing Ruby, I'm almost certain you'll still pick up a little trick here and there.
It doesn't pretend to be encyclopedic in the manner of The Ruby Way. However, where sometimes I find The Ruby Way curtails topics just when they start to get interesting, Brown dives deep with Ruby Best Practices.
Clear examples are accompanied by thoughtful and full treatments of the subject at hand. It has particularly useful focus on "Mastering the Dynamic Toolkit", "Text Processing", "Functional Programming Techniques", and "Designing Beautiful APIs".
Utter disappointment! I think the book got to be published just to grab a quick buck, while there was a huge ruby literature demand. It feels like almost no thought nor organisation was put into this publication. Some of the recommendations are actually now considered bad practices.
You are better off doing online research and reading blog posts than reading this book.
A fine Ruby book. It's a bit outdated - it came out when v1.9 was all the rage, but it still provides lots of useful insights with real-world code samples taken from open source projects; it's impossible to read this book without picking a few new, good tricks along the way. I particularly enjoyed the chapters on metaprogramming and functional programming.
The second most sophisticated book about Ruby I've read (the first being Flanegan book). It focuses or real examples and covers a lot in depth. I wish it was available when I first started programming in Ruby.
Really enjoying this. It might be the best technical book I've ever read. It's also really encouraging that coming back to this book after reading a few of the chapters online when the book came out, I understand the more challenging topics a lot better now.