Eloquent Ruby, Second Edition (PragProg)

Write elegant Ruby code—not just correct, but idiomatic. Go beyond the vocabulary and syntax and learn to express yourself with eloquence.

Russ Olsen @russolsen

Edited by Michael Swaine @michaelswaine

Write better, clearer, more focused Ruby code by becoming truly fluent in the language. To express yourself eloquently in any language, you need to go beyond its vocabulary and syntax. Ruby is an easy programming language to learn, but to gain the fluency needed to write great Ruby code, you need to break old habits. Start thinking about code the way experienced Ruby programmers do. Grok how they solve problems. Dig below the what to the why of Ruby conventions. Thoroughly updated to reflect modern Ruby usage and with new chapters covering pattern matching and concurrency, Eloquent Ruby, Second Edition will help you take advantage of the power and flexibility of the Ruby programming language.

Writing idiomatic Ruby code is easy: you just have to think like a Ruby programmer. By explaining the conventions and techniques of Ruby programming as well as the thinking behind those conventions and techniques, Eloquent Ruby, Second Edition provides you with the mental framework to create programs that take full advantage of this powerful language.

Dive into the core concepts of Ruby programming by starting small and working through to the bigger ideas. You’ll learn the basics of formatting Ruby code and then move on to constructing methods, classes, modules, and tests. From there, you’ll explore more advanced techniques such as metaprogramming and domain-specific languages. Along the way, you’ll learn to recognize common Ruby pitfalls and how to avoid them. You’ll also discover how to use the code behind popular Ruby gems and Ruby itself as a resource to improve your own code. Completely updated for Ruby 3.4, the book includes new material on recent additions to Ruby such as pattern matching and concurrency.

Whether you’re discovering Ruby for the first time or refreshing your knowledge of a familiar tool, the updated edition of this classic work will level up your ability to write clear, maintainable, and functional Ruby.


Russ Olsen is a software engineer, engineering manager, and compulsive technology explainer. An early adopter of Python, Ruby, and Clojure, Russ has written three technical books: Eloquent Ruby, Design Patterns in Ruby, and Getting Clojure, as well as the science fiction novel Overdrive. Russ is also an occasional conference speaker: his To The Moon keynote has brought tears to the eyes of audiences worldwide.


2 Likes

It’s really good to see a second edition of one of my favourite Ruby books of all time! This is what I said about it (and Russ’s other book, Design Patterns in Ruby) in my Best Way to Learn Ruby & Rails blog post:

Step 6 – Design Patterns in Ruby

Don’t be fooled by the age of this book – it’s still very relevant today, and absolutely without doubt, one of my all time favourites!

It’s all well and good knowing the fundamentals of a language (which you just learned from The Well Grounded Rubyist) but like any tool, it’s what you do with it that counts – and that’s where this book excels. It shows you how you might use Ruby in different situations.

Russ Olsen is clearly an eloquent writer, with a wealth of knowledge that he happily imparts in this easy to digest, amicably toned book. Another essential purchase.

Step 7 – Eloquent Ruby

Remember I said Russ Olsen was an eloquent writer? Fitting then, that he’s written Eloquent Ruby too!

When I read this book I highlighted so much of it on my Kindle that in the end, I thought forget that, I might as well read the book again later! There’s just so much in this book that you’ll find useful, interesting and noteworthy.

Eloquent Ruby teaches you how to use Ruby, well. Good clean idiomatic Ruby that you can be proud of. Apart from being a gifted writer, Russ is also an all round nice guy – and that warmth and friendliness shines through in his books – making them a very enjoyable read. Another essential purchase.

Needless to say I highly recommend this book and it won’t surprise you to learn @russolsen is one of my favourite tech authors :003:

I keep nagging him to write an Elixir book! Maybe one day, eh Russ? :-p

1 Like

Where are steps 1-5? :slight_smile:

1 Like

Oh wow! I didn’t expect this to be a Pragmatic book. It seems Addison-Wesley has been dropping the ball on the entire Ruby series of books. But hey I’m glad it’s on Pragmatic.

I still have the 1st Edition that I bought in 2014. Good book! Also, I second you @AstonJ, Design Patterns in Ruby is a good book! :slight_smile:

2 Likes

Here ya go Jake: Best way to learn Ruby & Rails – (via @AstonJ) :icon_biggrin:

I loved it! Russ is an all round amazing guy too, I nearly fainted when he followed me on Twitter all those years ago! :049:

1 Like

Hahaha, I can relate. 5 years ago, the Late Noah Gibbs(Rebuilding Rails) became my buddy. He even reviewed my CV for me when I asked, and a short while later, I landed a job(non-Ruby). It’s amazing what happens when the people you read and see actually step in and do human like things :slight_smile:

1 Like

Olsen’s 6th law is that books are more work than you think, even when you take all of Olsen’s laws into account.

As I find myself saying to you every so often, thanks for the kind words.

2 Likes

I started with Ruby many many years ago, but never got a chance to use it and ended up with C#.

1 Like