Rails AntiPatterns

Author: Chad Pytel and Tammer Saleh
Publisher: Addison-Wesley, 2010
Pages: 400
ISBN: 978-0321604811
Aimed at: Competent Rails developers
Rating: 4.5
Pros: Well-structured and thoughtful discussion of principles
Cons: Assumes a lot of prior knowledge
Reviewed by: Mike James

With the subtitle "Best Practice Ruby on Rails Refactoring" is this book worth adding to your library?

Ruby, and its best known framework Rails, seems to attract the sort of book that other languages and frameworks would be pleased to have. This one focuses on some very high level concerns. It is all about anti-patterns and how to both fix and avoid such problems.

The first thing to say is that you need to be a good Rails programmer to get anything much from the book. Although many of the anti-patterns are just standard problems that arise in other environments, the discussion is very Rails-centric. There is no way that this book attempt to teach you anything much about either Ruby or Rails, so it is unsuitable for the beginner. Not only is it unsuitable for the beginner, it is unsuitable if you are looking for a practical how-to or cookbook style. This is about deep thinking and principles.

 

Banner

 

It starts off with a look at what sorts of things go wrong with the Model - and to understand much of the discussion you need to know you MVC. At least you need to know what the objective of MVC is and how it is implemented in Rails. Each chapter outlines a problem or trap - i.e. an anti-pattern - and then provides a number of solutions. These are not do-this prescriptive solutions, but discussions of how the tendencies to over-do or misunderstand can be corrected. Occasionally I found that principles weren't discussed enough. For example if you don't know the arguments for the "law of Demeter" you will not appreciate why it is a proposed solution. In the main, however, the ideas are well described.

Chapters follow in the same basic style on the domain model, views, controllers, services, using third party code, testing, scaling and deployment and databases. Some are better than others but all are worth reading. You can feel free to disagree with some of the recommendations but if you do make sure you know the pros and the cons of not accepting the solutions. 

So who should read this book? I would say it is ideal for any Ruby on Rails programmer who has read the introductory books and is capable of building a Rails system. You need to be fairly sophisticated and know something about the ideas of good object-oriented design and having a some knowledge of patterns makes the book feel more like familiar territory. If you fit the profile then this is very well worth reading.

 

Banner


The Theoretical Minimum

Author: Leonard Susskind & George Hrabovsky
Publisher: Basic Books/Allen Lane
Pages: 256
ISBN: 978-0465028115 
Print: 0465075681
Kindle: B00B05XGSW    

Audience: Readers with solid background in Physics and Math
Rating: 5
Reviewer: Mike James

 

Want to really unders [ ... ]



Black Hat Python

Author: Justin Seitz
Publisher: No Starch Press
Pages: 192
ISBN: 9781593275907
Print: 1593275900
Audience: Experienced Pythonistas
Rating: 4
Reviewer: Alex Armstrong

 

A book that explains how to use Python to gain control and otherwise cause mischief isn't a good idea - is it?


More Reviews

Last Updated ( Thursday, 23 February 2012 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2015 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.