Ruby Best Practices

Ruby Best Practices

This book aims to help Ruby developers from a wide range of skill levels improve their fundamental understanding of the language via exposure to the common practices and idioms that many seasoned Rubyists take for granted.

Tag(s): Ruby

Publication date: 01 Jun 2009

ISBN-10: 0596523009

ISBN-13: 9780596523008

Paperback: 336 pages

Views: 16,466

Type: Book

Publisher: O’Reilly Media, Inc.

License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Post time: 19 Nov 2010 07:01:29

Ruby Best Practices

Ruby Best Practices This book aims to help Ruby developers from a wide range of skill levels improve their fundamental understanding of the language via exposure to the common practices and idioms that many seasoned Rubyists take for granted.
Tag(s): Ruby
Publication date: 01 Jun 2009
ISBN-10: 0596523009
ISBN-13: 9780596523008
Paperback: 336 pages
Views: 16,466
Document Type: Book
Publisher: O’Reilly Media, Inc.
License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
Post time: 19 Nov 2010 07:01:29
Summary/Excerpts of (and not a substitute for) the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported:
You are free to:

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms.

Click here to read the full license.
Excerpts from the Preface:
Gregory Brown wrote:Some programming languages excel at turning coders into clockwork oranges. By enforcing rigid rules about how software must be structured and implemented, it is possible to prevent a developer from doing anything dangerous. However, this comes at a high cost, stifling the essential creativity and passion that separates the masterful coder from the mediocre. Thankfully, Ruby is about as far from this bleak reality as you can possibly imagine.

As a language, Ruby is designed to allow developers to express themselves freely. It is meant to operate at the programmer’s level, shifting the focus away from the machine and toward the problem at hand. However, Ruby is highly malleable, and is nothing more than putty in the hands of the developer. With a rigid mindset that tends to overcomplicate things, you will produce complex Ruby code. With a light and unencumbered outlook, you will produce simple and beautiful programs. In this book, you’ll be able to clearly see the difference between the two, and find a clear path laid out for you if you choose to seek the latter.

A dynamic, expressive, and open language does not fit well into strict patterns of proper and improper use. However, this is not to say that experienced Rubyists don't agree on general strategies for attacking problems. In fact, there is a great degree of commonality in the way that professional Ruby developers approach a wide range of challenges. My goal in this book has been to curate a collection of these techniques and practices while preserving their original context. Much of the code discussed in this book is either directly pulled from or inspired by popular open source Ruby projects, which is an ideal way to keep in touch with the practical world while still studying what it means to write better code.

If you were looking for a book of recipes to follow, or code to copy and paste, you’ve come to the wrong place. This book is much more about how to go about solving problems in Ruby than it is about the exact solution you should use. Whenever someone asks the question "What is the right way to do this in Ruby?", the answer is always "It depends." If you read this book, you’ll learn how to go with the flow and come up with good solutions even as everything keeps changing around you. At this point, Ruby stops being scary and starts being beautiful, which is where all the fun begins.

Audience

This book isn’t really written with the Ruby beginner in mind, and certainly won’t be very useful to someone brand new to programming. Instead, I assume a decent technical grasp of the Ruby language and at least some practical experience in developing soft- ware with it. However, you needn’t be some guru in order to benefit from this book. The most important thing is that you actually care about improving the way you write Ruby code.




About The Author(s)


Gregory Brown (@practicingdev) has run the independently published Practicing Ruby journal since 2010, and is the original author of the popular Prawn PDF generation library. In his consulting projects, Gregory has worked with key stakeholders in companies of all sizes to identify core business problems that can be solved with as little code as possible. Gregory's relentless focus on the 90% of programming work that isn't just writing code is what lead him to begin working on Programming Beyond Practices.

Gregory Brown

Gregory Brown (@practicingdev) has run the independently published Practicing Ruby journal since 2010, and is the original author of the popular Prawn PDF generation library. In his consulting projects, Gregory has worked with key stakeholders in companies of all sizes to identify core business problems that can be solved with as little code as possible. Gregory's relentless focus on the 90% of programming work that isn't just writing code is what lead him to begin working on Programming Beyond Practices.


Book Categories
Sponsors