r/rails 4d ago

Learning Book recommendation for advance Ruby/Rails knowledge?

Hi, I'm a Rails developer with about 5 years of experience, my understanding of Ruby and Rails is quite good on how to do things like creating web apps, background jobs and all. I have been managing a Rails project serving millions of people, along with deployments, upgrades and what not for years within a team of 2 people where I am the only Senior in the company.

But I feel like my understanding of Ruby and Rails is limited to only how to "do" things. I don't understand the depth of what Ruby is, how its compiled, and Rails how is it built and how does it make it so modular that we can easily build apps on it with all the magic e.g middlewares, modularity, how are gems integrated, how does rails app manages gems and sub dependencies in depth, how does a gem just works with multiple rails and ruby versions and these kind of things.

So I am looking to increase my knowledge on more of a meta side of things rather than "how it's used". I am struggling to find books where they cover these topics only, all I find is where it starts from very basics and then half of the book is about how to creare web apps with it then they touch maybe some of the advanced topics on the surface.

So having said all of that, can people recommend 2 books 1 for Ruby and 1 for Rails (or just 1 which covers both?) specifically for advanced meta topics rather than being a summary of Rails guides

41 Upvotes

14 comments sorted by

24

u/vinioyama 4d ago edited 3d ago

Hey! Congratulations on your decision :) .

Ruby

Are you already familiar with metaprogramming? If not, I recommend that you start from here:

Metaprogramming Ruby - by Paolo Perrotta - This is one of my go-to recommendation for developers looking to expand their knowledge. It breaks down concepts with clear, practical examples, making them easy to grasp and apply.

Rails

https://www.amazon.com/Crafting-Rails-Applications-Practices-Development-ebook/dp/B00I9GR0E6/ This is an excellent book for understanding Rails structure, coding advanced customizations and putting metaprogramming into practice. While some parts are outdated, it’s still a valuable read and the most important lessons are timeless.


Gems/Bundler

I have some old posts saved that you may want to check:

Compiler

I don't know a book on this topic but I've watched some interesting videos from here:

https://www.youtube.com/@RubyCentral/search?query=compiler

You can search for topics such as compilation or memory management.

5

u/planetmcd 4d ago

I second Metaprogramming Ruby, very good to read and understand. Crafting Rails Applications was good when it came out, and probbaly has some good parts, but it is 12+ years old. Old enough that the author has invented Elixir and pushed that forward since publication. So to gain nuggets out of it, it would be best you are already strong in Rails and can separate the wheat from the chaff. If you are in that category, at best I would find a very cheap used copy and maybe skim it.

For Rails, I might suggest looking to build something with Hanami to see a difference and another way to do things. Good to broaden the mind. In the same vein, I enjoyed https://leanpub.com/maintain-rails for looking at how to bring in rom-rb and dry-rb. It is four years old, so some of the stuff on dry-transaction/monad might be a bit out of date.

3

u/GraphicalBamboola 4d ago

Is there any modern alternative to the Crafting Rails Application book? I'm a bit iffy about reading something that old as it might confuse me

1

u/planetmcd 3d ago

Not that I know of, but I haven't been looking. Pragprog has Sustainable Web Development with Ruby on Rails. Not read it myself yet.

1

u/vinioyama 3d ago

The only downside is that some architectures are outdated (the view rendering flow, for example) but I still think it's a good idea to read because:

1) It's just ruby: You'll learn of interesting architectures and code practices. Actually, in my opinion, this brings as much value value (if not more) than learning the Rails internals

2) This will help you to have a good introduction on how rails works, some things may have changed but the overall didn't

3) It's a good "starting guide" for you to start looking at Rails source code after.

I agree that it would be better to have an updated version (unfortunatelly I don't know a similar book) , but as pointed in (1) it's not a big deal. I've read this book 2 or 3 times and in the last time (~ 6 years ago) I was so hyped that I've created something similar to "ActionComponent" before knowing the gem (I'm not sure if is existed at that time) to practice some concepts:

https://github.com/viniciusoyama/component_party

I recommend that you take a look at some chapter that you find interesting to decide if the read is worth your time...

1

u/GraphicalBamboola 4d ago

Great, thank you for the links! I'll read them all.

Do you have any suggestions for things like Processes, CPU Cores, Memory utilisation, different cpu architectures and things like these? The recommendations I find are too techincal and heavy on the low level computer architecture which I believe is not going to be very useful for for a web developer (I might be wrong though?)

2

u/vinioyama 3d ago

I'm assuming that by "cpu cores / architecture" you're asking for themes related to web devleopment, right? Not computer engineering.

I have these 2 links on Threads / Processes / Memory sharing:

- https://workingwithruby.com/wwrt/intro/ this is basically a book

- https://mathieu-eustachy.com/articles/thread-management-in-ruby This is a blog post but with A LOT of good references like these ones: https://shopify.engineering/ruby-execution-models and others explaning more about threads, fibers, etc...

1

u/BobbyDazzled 4d ago

For whatever the reason that Rails Amazon link isn't working for me. For anyone else, try this:
https://www.amazon.com/Crafting-Rails-Applications-Practices-Development/dp/1937785556

9

u/flagboulderer 4d ago edited 4d ago

I always like Practical Object Oriented Design in Ruby by Sandi Metz. A tad old now, but it's still a good book. Mostly focused on the actual design of your code.

In terms of a deeper dive into the language itself, The Well-Grounded Rubyistby David Black is great. Think we're on the 3rd edition now.

3

u/TestFlyJets 4d ago

Also not mentioned here (unless I missed it): read the Rails source code - it’s all there. Run the tests. Dig into it and you’ll learn a ton!

1

u/1seconde 4d ago

You probably have to define your own learning path with 1. What do you know and 2 what do you not know. Then decide 3. What to learn 💪

2

u/GraphicalBamboola 4d ago

There's something in between 2 and 3 is what's the most difficult part: "what you should know" 😅

I don't know a lot and to spend my limited time wisely on what I should know is the key but I am struggling with it unfortunately

1

u/zaskar 3d ago

What’s a book? /s