Polished Ruby Programming

3 mins read

I first learned about Jeremy from his amazing Open Source work on Sequel, Rodauth, and Roda libraries. All these RubyGems are advanced in design and leading in performance. Almost always have zero open issue and Pull Request. Not because no one uses it, but meticulous maintenance and careful considerations from the beginning. All at excellent extensibility, quality, and solves the domain program like no better one. This book reveals how.

I was lucky to hear Jeremy speaking in person at RubyKaigi in Fukuoka, Japan in 2019. He gave a talk called Optimization Techniques by Benchmark Winners. Then I always want to learn more from him. I was so happy to find out he announced Polished Ruby Programming. This is a very welcome book to the Ruby community. There are not many new books about Ruby anymore. Here we have a new one. A very good one.

This book is like a observe seat watching a seasoned Ruby Programmer writing Ruby programs. To understand how they understand the problem. What constraints are out there. What options we have. Why they make that decision. Why they don’t make an obvious decision. This book teaches a way to think when programming in Ruby.

This book does not teach you the basics. This book does not teach you tricks. This book gives you useful solid advice based on real-world experiences. This book clears some subtlety you may be doing it all the time but hasn’t looked into why. This book teaches some advanced Ruby Programming techniques in case you need them. This book is an excellent overview of most Programming in Ruby.

Each chapter introduced the domain first. Present you pragmatic approaches. Considerations we need to think about. Then present you working suggestions with a recap summary in the end of each chapter. Each chapter has working, idiomatic, well-thought example runnable programs. While the book itself does not display code very well, code is available with one git clone away to follow along.

All the advice is based on the major version of Ruby 3.0. This book explained 90% of how to use Ruby well with solid reasoning and trade-offs considered. The last 10% is left to us to apply these principles in daily programming. Highly recommend if you want to learn more about programming in Ruby. To understand why we program this way.

This book lists out principles. Why we use one. How we implement from the ground up. How an alternative solution might be more appropriate for some particular scenarios. This helps us to understand the range of possibilities. Think about trade-offs as we program in Ruby. But it is not a checklist, it is about Why and How.

This book is also a rare kind of book. To find a Ruby Committer who uses Ruby well. Who knows Ruby well. Who has maintain Ruby libraries well. Who has abundant experiences. Who can explain these things well. Who is willing to write a book. Who writes well. Who has the time after day job, to put all these together into a Book. In a difficult time like we are in right now. It is almost impossible. I feel nothing but grateful to read this book.

Although this book already taught us so much in about 1000 pages. I still wish he would write another “sequel” that covers topics like Concurrency in Ruby (Threads, Fiber, Ractor). Explain choices in widely-used Libraries like Rack, Sidekiq, and Puma. Elaborate more topics on Ruby’s most popular application field, web applications. How to address harder problems when programming in Ruby.

I am certain this book will influence many Rubyists for many years to come. I recall he mentioned a program has 3 phrases: Work, fast, fun. This book helps us get past the first two. We us a community can spend more time having fun programming with Ruby. Happy Hacking, yayy! Thank you Jeremy for writing this gem. Highly recommended this book. Get it!