Eloquent Ruby

Author: Russ Olsen

Publisher: Addison-Wesley
Pages: 448
ISBN: 978-0321584106
Aimed at: Anyone wanting to be a good programmer
Rating: 5
Pros: A great guide to good style
Cons: Sometimes a bit too enthusiastic
Reviewed by: Mike James

This book will make you a better programmer. Read on to find out how and why.

Author: Russ Olsen
Publisher: Addison-Wesley, 2011

Pages: 448
ISBN: 978-0321584106
Aimed at: Anyone wanting to be a good programmer
Rating: 5
Pros: A great guide to good style
Cons: Sometimes a bit too enthusiastic
Reviewed by: Mike James


This is a great book and even if you don't use Ruby it is a book well worth reading. It does major on the way that you should use Ruby and how to write Ruby in a way that is true to the language, but it has so much to say about programming in general that it is worth reading for non-Ruby programmers. It is would also be an eye-opener to compare the way your favourite language stacks up to Ruby as explained in this book.



Chapter 1 starts off the quest to write honest Ruby with "Write Code that Looks Like Ruby". The basic idea is that clarity is all. A program should shout its intent. This chapter takes us through some obvious stuff but it does it in an engaging way that makes the points clearly and persuasively. I didn't agree with all of the points, but then you don't have to. As long as you understand the reasoning and try to make your code clear you can pick your own idioms.

Chapter 2 continues this argument with a look at control structures and a topic that I think is important - use positive logic. As the author points out it is the difference between

"It is not true that Ruby is like Java"


"Ruby is different than Java".

There is also the problem of taking the not of an and or an or which is more difficult than you might think as not(A and B) is (not A) or (not B). This problem isn't discussed.

From these very general opening chapters the book moves into increasingly more specific areas of Ruby. Chapter 3 looks at smart collections, Chapter 4 at smart strings, Chapter 5 regular expressions and Chapter 6 deals with the mysterious topic of symbols. Then we move on to more general topics. Chapter 7 titled - Treat everything like an Object - because everything is. Chapter 8 on dynamic typing and chapter 9 on specs and test.

Part II of the book is on larger architectural issues - Classes, Modules and Blocks - but don't let my description put you off. This part of the book explains how to make use of the basic organizational principles for code. Chapter 10 explains what makes a good class. Chapter 11 deals with operators and defining your own. Chapter 12 is on class equality, 13  is on the singleton pattern, 14 on instance variables, 15 on modules as namespaces, 16 on modules as Mixins. Chapter 17 looks at the use of Blocks in iteration, Chapter 18 is a collection of uses for blocks and Chapter 19 is about saving blocks for deferred execution.

Part III is about metaprogramming - something Ruby is very good at. This outlines the usual techniques for modifying and extending the Ruby language - hooks, method_missing, monkey patching, self modifying classes and classes that modify their subclasses.

Part IV is about putting it all together and it majors on creating Domain Specific Languages - again something Ruby is very good at. There are two chapters on DSLs, a chapter on packaging your code as a Gem and a final one on the different Rubys.

This is a really good book and at the end of it you can't help but write better Ruby and probably better whatever other languages you use now or in the future. In this sense it will make you a better programmer.


Street Coder (Manning)

Author: Sedat Kapanoglu
Publisher: Manning
Date: February 2022
Pages: 272
ISBN: 978-1617298370
Print: 1617298379
Kindle: B09Q3PJQC5
Audience: General
Rating: 4
Reviewer: Ian Elliot
Street Coder - sounds sort of tough but messy at the same time.

Python All-in-One, 2nd Ed (For Dummies)

Authors: John Shovic and Alan Simpson
Publisher: For Dummies
Date: April 2021
Pages: 720
ISBN: 978-1119787600
Print: 1119787602
Kindle: B091DGDLK8
Audience: People wanting to learn Python
Rating: 2
Reviewer: Mike James
All-in-one refers to the fact that this is seven books put together - why?

More Reviews

Last Updated ( Tuesday, 05 July 2011 )