Customers who viewed this item also viewed
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the authors
OK
Rails AntiPatterns: Best Practice Ruby on Rails Refactoring (Addison-Wesley Professional Ruby) 1st Edition
As developers worldwide have adopted the powerful Ruby on Rails web framework, many have fallen victim to common mistakes that reduce code quality, performance, reliability, stability, scalability, and maintainability. Rails™ AntiPatternsidentifies these widespread Rails code and design problems, explains why they’re bad and why they happen—and shows exactly what to do instead.
The book is organized into concise, modular chapters—each outlines a single common AntiPattern and offers detailed, cookbook-style code solutions that were previously difficult or impossible to find. Leading Rails developers Chad Pytel and Tammer Saleh also offer specific guidance for refactoring existing bad code or design to reflect sound object-oriented principles and established Rails best practices. With their help, developers, architects, and testers can dramatically improve new and existing applications, avoid future problems, and establish superior Rails coding standards throughout their organizations.
This book will help you understand, avoid, and solve problems with
- Model layer code, from general object-oriented programming violations to complex SQL and excessive redundancy
- Domain modeling, including schema and database issues such as normalization and serialization
- View layer tools and conventions
- Controller-layer code, including RESTful code
- Service-related APIs, including timeouts, exceptions, backgrounding, and response codes
- Third-party code, including plug-ins and gems
- Testing, from test suites to test-driven development processes
- Scaling and deployment
- Database issues, including migrations and validations
- System design for “graceful degradation” in the real world
- ISBN-100321604814
- ISBN-13978-0321604811
- Edition1st
- PublisherAddison-Wesley Professional
- Publication dateNovember 9, 2010
- LanguageEnglish
- Dimensions7 x 0.77 x 9.13 inches
- Print length340 pages
Customers who viewed this item also viewed
Design Patterns in RubyHardcoverFREE Shipping by AmazonGet it as soon as Monday, Apr 27Only 1 left in stock - order soon.
Customers also bought or read
- Layered Design for Ruby on Rails Applications: Discover practical design patterns for maintainable web applications
Paperback$49.99$49.99FREE delivery Tue, Apr 28 - Ruby on Rails Tutorial: Learn Web Development with Rails (Addison-Wesley Professional Ruby Series)
Paperback$43.71$43.71FREE delivery Mon, Apr 27 - Polished Ruby Programming: Build better software with more intuitive, maintainable, scalable, and high-performance Ruby code
Paperback$54.99$54.99FREE delivery Tue, Apr 28 - Practical Object-Oriented Design: An Agile Primer Using Ruby
Paperback$40.33$40.33FREE delivery Mon, Apr 27 - Programming Ruby 3.3: The Pragmatic Programmers' Guide (Pragmatic Programmers; Facets of Ruby)
Paperback$58.31$58.31FREE delivery Mon, Apr 27 - The Rspec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends (Facets of Ruby)
Paperback$21.39$21.39FREE delivery Apr 29 - May 5 - Effective Ruby: 48 Specific Ways to Write Better Ruby (Effective Software Development)
Paperback$34.96$34.96Delivery Mon, Apr 27 - Modern Front-End Development for Rails: Hotwire, Stimulus, Turbo, and React
Paperback$55.95$55.95FREE delivery May 9 - 14 - Effective Testing with RSpec 3: Build Ruby Apps with Confidence
Paperback$14.71$14.71Delivery Mon, Apr 27
Editorial Reviews
About the Author
Tammer Saleh has built a career developing, managing, and building the infrastructure that drives the modern day cloud. He's acted as the VP of Engineering for Cloud Foundry at Pivotal, and before that he ran the BOSH team as product manager. He now runs SuperOrbital (http://superorbit.al), a consulting company that helps enterprise companies understand and adopt cloud-native technologies.
Product details
- Publisher : Addison-Wesley Professional
- Publication date : November 9, 2010
- Edition : 1st
- Language : English
- Print length : 340 pages
- ISBN-10 : 0321604814
- ISBN-13 : 978-0321604811
- Item Weight : 1.22 pounds
- Dimensions : 7 x 0.77 x 9.13 inches
- Part of series : Addison-Wesley Professional Ruby Series
- Best Sellers Rank: #3,932,475 in Books (See Top 100 in Books)
- #94 in Ruby Programming
- #23,879 in Computer Science (Books)
- Customer Reviews:
About the authors

Tammer Saleh is a long time developer, leader, and author of the acclaimed book Rails AntiPatterns.
As founder of Thunderbolt Labs, he helped San Francisco companies build agile teams and ship scalable products. As VP Engineering at Engine Yard, Tammer ran the development team and the flagship Cloud product. Previous lives include C/C++ AI programming, as well as UNIX administration for Citysearch.com and Caltech’s Earthquake Detection Network.
Tammer is currently building the Cloud Foundry platform at Pivotal. You can read more about him at http://tammersaleh.com.

Chad Pytel is founder and CEO of thoughtbot, inc. a leading software development firm that specializes in agile, test-driven web application development using Ruby on Rails. He currently lives in Newton, MA with his wife and son.
Products related to this item
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 AmazonCustomers say
Generated from the text of customer reviewsSelect to learn more
Top reviews from the United States
There was a problem filtering reviews. Please reload the page.
- Reviewed in the United States on July 26, 2014Format: PaperbackVerified PurchaseThe ideal and essential book for intermediate level people learning rails. You've gone through the rubyonrails.org guide(s), maybe even micharl hartl's, or baserails (excellent, not so well known resource btw). Now, what? How do you build your own complex idea that have more than just has_many associations, or are clones of popular apps? What does fat model actually mean in practice? How do I loosely couple and APPLY law of demeter?
This book is not just about what not to do, or refractoring things to that it's extra "rails-y". The reason it's so valuable for intermediate developers is because by seeing the recommended ways to implement, and organize your code, against anti-patterns (aka bad practices that don't fully utilize what rails designed to make neat and concise), you get to LEARN the rails methods and features that don't even show up in all of the beginner rails tutorials in out there, and you get to learn exactly how to USE methods and features that rails has to offer without going into ultra low level ruby that leave you scratching your head, and frustrated.
Just like how object oriented design philosophy tells you to use interfaces to not care about the detailed implementation of distant objects, so too should teaching something relatively complicated and confusing like a framework teach you how and what to use its methods and features without bogging you down with every single detail about the method, or approaching it from such a highly academic, and non-practical way. This book does just that. It gives you a bad example, explains the most useful and practical way of improving it, shows you the new example (even multiple examples as it increments the improvements by illustrating one concept at a time), and you end up with the knowledge to APPLY those principles concretely to your own app you might be building. APIs, the rubyonrails.org guides, even apidock doesn't do this that well. As good as stack overflow is, it's quite difficult to get to know rails well as an intermediate level learner of rails, since SO's answers are often not organized, go into too much or too little detail, can be targeted at advance level developers, as well as you not knowing what you should study next.
Sandi Metz's design patterns in ruby book is extremely well written, and rated extremely highly. You will see the similar styles, intentions of conveying thorough, but concise knowledge of practices, and also find it very useful. while object oriented programing in ruby is important, and very good, you will end up not knowing how to implement it, as it is rather distant from rails. This book is what you should read before Sandi's book, where it's in a similar style, but very applicable and very actionable to rails, and your project(s) that you may be building for a portfolio to land that junior rails developer job.
I'm very surprised this book doesn't have that many reviews. I think it is truly one of the essential books in the track for someone who wants to become a senior developer from zero programming familiarity. This book fills an essential gap in the spectrum of difficulty and progress.
P.S. to those who say this book contains too many useless, and obvious bad design patterns: where did you learn these concepts before? I couldn't find many good resources. Even if they're out there, curation is quite a valuable thing. Any review like that should be cognizant of the level of experience imo. Perhaps this book is not as good for seasoned rails developers. But it is truly one of the best and rare resources that fills a ladder rung in the path from beginnerhood to expertise. Again. I'd love to know where other rails developers learned the patterns and practices if not from this book. While working in a company with experienced developers? Well, not everyone has that kind of access to resources. To some, it's a catch-22, where you need to build a portfolio to get a job to get mentored. Disregarding all of that, it's still useful to not to have to rely on person-to-person training, or have to rely on reading the source code. Some people truly are great at code, and can read source code from ground-up as a primary learning method. Some are already seasoned in ruby and rails enough to read it as well. I think seasoned developers are too ignorant of this reality. Others have different learning styles. Some teaching methods are simply statistically faster, easier, and more effective. And for sure that method is not reading the source code.
Disclaimer: I have NO ties or conflicts of interest with any of the resources mentioned in this review.
- Reviewed in the United States on March 17, 2011Format: PaperbackVerified PurchaseI'll be honest, prior to reading this book I was starting to lose faith in Ruby on Rails authors. As a beginner to Rails, I've read a number of books to try and make sense of all the black magic going on behind the scenes as well as how to write great code in Rails. Many of those books were either "paint by number" tutorials where you didn't really learn anything appreciable or very complete (and hard to comprehend) reference manuals for everything there is to possibly know about Rails.
I just needed a good in between book! This book not only exposes you to the Rails Way of writing code in Ruby on Rails, it also gives many of the opposing examples which I would more than likely stumble down not knowing any better.
Not only that, but this is one of the most logically organized books I have ever had the pleasure to read. Everything flows together very nicely and is very understandable for beginners let alone more advanced users.
I would recommend this book in a heart beat (and I already have... many, many times). Great job guys! I really appreciate the effort you put into writing this book! You have restored my faith in Rails authors!
- Reviewed in the United States on July 9, 2019Format: PaperbackVerified PurchaseReferences some gems and techniques that are a little outdated but in general a very very helpful resource to take your code from “done” to “done well”.
- Reviewed in the United States on June 15, 2011Format: PaperbackVerified PurchaseAll too often, the 'patterns' books only develop a greenfield example the 'right' way. This is hopelessly optimistic, especially if (as is the case for me) you're teaching undergraduates how to use design patterns; they're not going to get it right the first time. So *refactoring* code that has "grown bad" to use a good pattern is a much more frequently needed skill.
There are other books on refactoring for Ruby, like Martin's, but i like that this one focuses on design patterns and specifically on how to leverage Ruby's features to realize the patterns nicely.
My future coverage of design patterns in Berkeley's undergraduate software engineering class will be motivated by the examples in this book.
- Reviewed in the United States on December 9, 2010Format: PaperbackVerified PurchaseThis book makes a great companion to Martin Fowler's Refactoring book (or the Ruby version of it by Jay Fields). As someone who's still accumulating the theoretical 10,000 hours of experience it takes to master something (Ruby/Rails), it's nice to have guides like Chad and Tammer there to suggest improvements to my technique. Highly recommended for anyone novice or intermediate Rails developer.
- Reviewed in the United States on August 26, 2011Format: PaperbackVerified PurchaseI am not a ROR expert by any stretch (I have been coding on it for about 10 months) however I was able to digest this book in about 2 hours a few months back. The explanations are extremely clear, some of the lessons are sounds others are pretty obvious. For example I found the chapter on Views (ch. 3) and the one on Controllers (ch. 4) quite useful, while ch. from 6 to 8 not so much.
Overall a very useful book for novice, almost a must-have I would say. Not so much for more advanced programmers.
My suggestion is check the book out before you buy it.
- Reviewed in the United States on March 4, 2014Works great as a resource to thumb through when you need to. I read it from beginning to end and just ate up every chapter. It has been a month since I read it and my work has improved immensely.
- Reviewed in the United States on December 31, 2012Format: PaperbackVerified PurchaseLearned some points. Though some other points are obvious for experienced rails developers. It would be more useful for new rails developers.
Top reviews from other countries
Tim B.Reviewed in the United Kingdom on November 22, 20163.0 out of 5 stars This book is good but really out of date
This book is good but really out of date. I think it was written for Rails 2, with later updates for Rails 3.
-
Amazon カスタマーReviewed in Japan on October 11, 20185.0 out of 5 stars リファクトリングに最高の本
Rails5.2 でも通じるリファクトリングの素晴らしさがつまっています。
Railsでもっとうまくコードを書きたい方におすすめの本です。
(経験者の方には当然の内容かもしれません。)
素晴らしい、私の中では名著です。




