Ruby Science is a book written by the popular Rails shop, Thougtbot. I had the opportunity to try out their upcase program a few months ago but cancelled it because it wasn't what I was looking for.
I however have recently acquired their Ruby Science book and absolutely love it. If you like myself, are newer to programming, Ruby, or just look for better ways to write your code, then I highly suggest this book.
I began reading this book last Friday and accidentally read the whole thing by Sunday, it was that good. I have usually taken the approach of reading books slowly and pondering on the concepts to really get them but this book was just too good. It might be hard to tell but I am pretty excited about this book.
I did not realize at first but the way this book is written is sort of a choose your own adventure style, where the book is broken up in 3 sections., Code Smells, Solutions, and Principles.
The Code Smell section is full of code that looks like what I would write, good code but bad practices, for example a "Long Method." Methods are meant to be short 3-7 lines and if they are larger they can probably be refactored. This chapter was so eye opening I went back to a pull request I created that Friday morning and made tons of changes and got some pretty awesome comments from my coworkers on my abstraction, little did they know it was because me reading this book.
The second section is on Solutions. You hear a lot of talks and know the buzzwords about writing clean code, but this book really breaks it down to the point where you just get it. There is definitely no fluff and extravagant examples but I really enjoyed this approach in the book. To get an idea of what I am talking about, the book is as straight as the front cover, right to the point of everything.
The final section is on Principles in programming. I learned what the Law of Demeter was because of this section, as well some other really big terms. I have heard of so many of the terms but never really knew their meanings. I actually knew of the Law of Demeter Concept but did not realize what it was called. It's the idea keeping your method calls to one and not chaining method onto to method on to method, i.e. `run.forest.run` .
When I first started this programming journey, I watched a fair bit of conference talks, most that went over my head. I recently was re-watching CatchupConf, specifically Ben Orenstein's talk on Refactoring and found that so many of those concepts explained that I didn't understand, I now understand and even have been using these past 3 months working as a developer.
Here is a sample of the book: Ruby Science
Hi, i just bumped to your post about ruby science.
ReplyDeleteI am a bit confused on how to read this book.
Which way did you use to read this book?
Thanks
Read it like a reference, i.e. "like a dictionary"
ReplyDelete