Articles

Better OOP Through Lazily-Instantiated Memoized Dependencies

There are various schools of thought around how best to define dependencies in your object graph. Let’s learn about the one I prefer to use the majority of the time. It takes advantage of three techniques Ruby provides for us: variable-like method calls, lazy instantiation, and memoization.

Continue Reading

Static Typing in Ruby 3 Gives Me a Headache (But I Could Grow to Like It)

It kinda sorta works—with several asterisks. Hence the reason it took me so long to even write an article about Ruby 3 typing. I think I’m onboard with where this is all headed, but we have a ways to get there.

Continue Reading

Ractors: Multi-Core Parallel Processing Comes to Ruby 3

Historically, the only way you could truly achieve async parallelism in Ruby would be to fork multiple processes or schedule background jobs. Until now.

Continue Reading

Everything You Need to Know About Destructuring in Ruby 3

How improved pattern matching and rightward assignment make it possible to “destructure” hashes and arrays in Ruby 3.

Continue Reading

Ruby on the Frontend? Choose Your Weapon

We all know that Ruby is a great language to use for the backend of your web application, but did you know you can write Ruby code for the frontend as well?

Continue Reading

If Ruby Had Imports…

Sometimes it’s bonkers how much you have to import in other languages in every file before you get to the actual code. Thankfully Ruby provides a better way.

Continue Reading

Where Do Ruby Blocks Come From?

Let me set the mood, because it’s time to get reflective. Here’s your primer on block bindings, local variables, receivers, and more.

Continue Reading

Why the Release of Ruby 3 Will Be Monumental

Ruby 3 is an exciting update with lots of new features—yet I think it’s the psychology of turning over from major version 2 to 3 that is most vital to the future health of the Ruby community.

Continue Reading

Gsub Blocks, Partitions, and StringScanners, Oh My!

Ruby gives you a lot of flexibility right out of the box when it comes to manipulating text due to its Perl-flavored heritage. Let’s dig into what’s possible!

Continue Reading

Adding and Merging ActiveRecord Relations

The expressive possibilities of assembling ActiveRecord queries out of disparate parts make using Rails so fun.

Continue Reading