Ruby for Rails
8 comments | Posted: 31 May 06 in Books, by Robert Evans
I recently finished reading the PDF version of Ruby for Rails authored by the talented David A. Black. This book was release in printed version this month and I was pleased to receive mine a few days ago. Ruby on Rails has really taken the web by storm. This powerful framework has shed light on Agile Development Practices that have been previously talked about in the programming world, but haven’t had the acclaim as it does now.
Ruby for Rails, takes the Rails programmer on the journey of learning and developing his/her Ruby skills. I think David Hansson, creator of Rails, states it well in the forward of this book:
“Ruby is such an incredibly rich and expressive language that it’s hard to appreciate its beauty by simply relating it to past experiences with other languages”.
In this book, David Black shows his passion for Ruby and his ambition to teach it to others who desire to learn. The book is not like other technical books of the past, it is easy to read, easy to follow and there are code snippets with great explanations of the how’s and why’s of using it. The follow is what this book covers:
- The Ruby / Rails Landscape
- Ruby Building Blocks
- Built-in Classes and Modules
- Rails through Ruby, Ruby through Rails
The first section of this book takes you through the basics of how Ruby works and how Rails works, then about Ruby informed Rails. The first chapter teaches you the basics of the Ruby language such as, syntax, operators like the plus sign, Interactive Ruby (irb), method calls, the anatomy of the Ruby environment, extensions and libraries, and walks you through the creation of your first Ruby (no Rails) program.
The second chapter talks about the MVC, or Model-View-Controller framework architecture and Rails implementation of it. The chapter also shows you how to create your first Rails application, that later on the book walks you through finishing. It also teaches you what your code is doing.
The last chapter in this section takes what you have learned in the previous two chapters and brings it all together showing you why knowing and understanding Ruby will make you a better Rails programmer.
What I really like about the first part of this book, is that it not only is great for first time Ruby/Rails programmers, but it also a great refresher for those who know a bit of Ruby, but aren’t experts in the language. David does a great job at and hitting a wide range audience.
Ruby Building Blocks
This and the next section is the core of the book. David does a great job at explaining Objects, Classes and variables and how and when to implement them. He covers that everything in Ruby is an object with many great examples for you to test out. He covers Modules and the self object, which are often difficult subjects in Ruby to grasp. He explains the difference between Modules and Classes and discusses best practices of when to use one over the other.
David covers Control Flow Techniques such as loops, conditional statements, iterators and error handling. He gracefully explains code blocks that leaves you with, “Ah! Now that makes sense!”
Built-in Classes and Modules
The second core section of this book takes from the previous section and builds on what you just learned. It takes you more in depth with iterators, talks about how you can call your methods with syntactic sugar rather than the method-call notation. An example would be that you can define a plus sign method on an object you’ve created.
The section goes on to talk about Scalar objects, collections, enumerability, regular expressions and regexp-based string operations and Ruby dynamics.
Rails through Ruby, Ruby through Rails
This last section walks you through creating a Music application and ends up taking you in depth through programmatically enhancing ActiveRecord, enhancing controllers and views and gives you great techniques for exploring the Rails source code.
David does a brilliant job at ending this book with such valuable information for those who desire to write plugins for Rails, and learn more about the inside guts of the framework they are using.
This book is by far one of the best purchases I have made to develop my own Ruby and Rails skills. It takes the approach of focusing in on those who are beginner Rails programmers on up to those who have been programming in Rails for some time, but have not gone through Ruby in depth to better understand Rails. This book is not a complete Ruby reference, but rather a comprehensive Ruby tutorial.
I have read several Ruby books, and not one comes close to matching David’s style that is informative, passionate, and shows a strong desire and ambition to teach Ruby. This is by far the best book currently on the shelves for those who want to understand Ruby better and become a better Rails and Ruby programmer. The only thing you stand to lose by reading this book is becoming more knowledgeable about the language and framework.
Discuss This Topic
Comments closed after 2 weeks.