Sponsored

Customers who viewed this item also viewed

Buy used:
$5.98
Used: Good | Details
Sold by Orion LLC
Condition: Used: Good
Access codes and supplements are not guaranteed with used items.
Only 1 left in stock - order soon.
Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Sponsored
Kindle app logo image

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.

QR code to download the Kindle App

  • Rails AntiPatterns: Best Practice Ruby on Rails Refactoring (Addison-Wesley Professional Ruby)

Follow the authors

Get new release updates & improved recommendations
Something went wrong. Please try your request again later.

Rails AntiPatterns: Best Practice Ruby on Rails Refactoring (Addison-Wesley Professional Ruby) 1st Edition

4.6 out of 5 stars (41)

The Complete Guide to Avoiding and Fixing Common Rails 3 Code and Design Problems

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

Editorial Reviews

About the Author

Chad Pytel is the founder and CEO of thoughtbot, a software development firm specializing in Ruby on Rails, and creators of Paperclip, Shoulda, FactoryGirl, and Hoptoad, among other projects. thoughtbot embraces both agile development methodologies and a “getting real” project philosophy. Chad coauthored Pro Active Record: Databases with Ruby and Rails (Apress, 2007) and has presented at various conferences around the world. To follow along with Chad and the rest of the thoughtbot team’s ideas on development, design, technology, and business, visit their blog at http://robots.thoughtbot.com.

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)
  • Customer Reviews:
    4.6 out of 5 stars (41)

About the authors

Follow authors to get new release updates, plus improved recommendations.
Sponsored

Customer reviews

4.6 out of 5 stars
41 global ratings
Sponsored

Customers say

Customers find the book very useful, with one noting it serves as a fantastic refactoring resource and another mentioning it's a great companion to Martin Fowler's Refactoring book. The content receives positive feedback, with multiple customers describing it as a must-read for Rails programmers.
AI Generated from the text of customer reviews

Select to learn more

12 customers mention usefulness, 10 positive, 2 negative
Customers find the book very useful and applicable, working well as a resource, with one customer noting it serves as a fantastic source of refactoring ideas and another mentioning it's a great companion to Martin Fowler's Refactoring book.
...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...Read more
...and the one on Controllers (ch. 4) quite useful, while ch. from 6 to 8 not so much....Read more
...rails dev should read more than once, it so well written and examples are really good....Read more
...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...Read more
6 customers mention content, 6 positive, 0 negative
Customers find the content of the book very good and highly recommend it for Rails programmers, with one customer noting it's particularly essential for intermediate level developers.
A must read for Rails programmers. Very applicable, made me want to refactor a lot of my code and made me a better programmer.Read more
The ideal and essential book for intermediate level people learning rails....Read more
...Highly recommended for anyone novice or intermediate Rails developer.Read more
Good bookRead more

Top reviews from the United States

  • Reviewed in the United States on July 26, 2014
    Format: PaperbackVerified Purchase
    The 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.
    6 people found this helpful
    Report
  • Reviewed in the United States on March 17, 2011
    Format: PaperbackVerified Purchase
    I'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!
    24 people found this helpful
    Report
  • Reviewed in the United States on July 9, 2019
    Format: PaperbackVerified Purchase
    References 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, 2011
    Format: PaperbackVerified Purchase
    All 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.
    11 people found this helpful
    Report
  • Reviewed in the United States on December 9, 2010
    Format: PaperbackVerified Purchase
    This 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.
    8 people found this helpful
    Report
  • Reviewed in the United States on August 26, 2011
    Format: PaperbackVerified Purchase
    I 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.
    6 people found this helpful
    Report
  • Reviewed in the United States on March 4, 2014
    Works 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, 2012
    Format: PaperbackVerified Purchase
    Learned 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

Translate all reviews to English
  • Tim B.
    3.0 out of 5 stars This book is good but really out of date
    Reviewed in the United Kingdom on November 22, 2016
    This book is good but really out of date. I think it was written for Rails 2, with later updates for Rails 3.
  • Amazon カスタマー
    5.0 out of 5 stars リファクトリングに最高の本
    Reviewed in Japan on October 11, 2018
    Rails5.2 でも通じるリファクトリングの素晴らしさがつまっています。
    Railsでもっとうまくコードを書きたい方におすすめの本です。
    (経験者の方には当然の内容かもしれません。)
    素晴らしい、私の中では名著です。
    Report