Gnarly Learnings from October 2022

Engineering Insights

#
Min Read
Published On
March 13, 2025
Updated On
March 24, 2025
Gnarly Learnings from October 2022

We love reading, watching, and listening in order to keep our skills sharp and our perspectives fresh. Here are some of the resources we learned from this month.

The Practical Effects on the GVL on Scaling in Ruby

In "The Practical Effects of the GVL on Scaling in Ruby", Nate Berkopec provides a great practical overview of parallelism and concurrency, along with the challenges they pose to C-based interpreters. The post is a few years old-Ractors are now a reality-but the exposition is well worth a bit of mental fast-forwarding.  Short version: We commonly separate tasks into those that are CPU-bound, spending most of their time executing instructions, and those that are I/O bound, spending most of their time waiting for data to be sent or received. In order to make the best use of the C-based Ruby interpreter, you need to assess where your job falls on this spectrum.

extend self in Ruby

Modules are a great way to encapsulate logic that is shared between objects. But what if you want to use that logic directly (e.g. MyModule.my_method)? Turns out this is not callable unless it's defined as def self.my_method. Though doing this would mean other objects that extend MyModule would no longer be able to call that method; not what we want. If instead MyModule extends itself, #my_method becomes directly available on MyModule and remains available on any objects extending MyModule!

ActiveRecord Supports Postgres Enum Types

Enums are great for hardening up validations. But reading integer values can be a little cryptic. One solution is to use Postgres's enum types in migrations. And now Rails 7 gives us a power-up with Postgres enumerated types baked into AR.

Web Almanac: JavaScript in 2022

The Web Almanac, unlike the Farmer's Almanac, won't tell you when winter begins or how long after the last full moon in October you should plant your garlic, but it does provide insight into the state of the web. This section focuses specifically on JavaScript, its trends, and usages but there are other goodies in the almanac too - definitely take the time to check out the other sections on CSS, UX, markup, and more!

redirect_back_or_to

Sometimes, we don't know exactly where we want to go or how we want to get there. For times like these, we can reach for handy methods like redirect_back_or_to. By default, the browser will be redirected back to the referrer. The referrer is determined via a request header (HTTP Referer (sic)) - which isn't always available because it is based on browser security settings and user preferences. But even in the event that the header is missing, it's all gravy because we can provide a fallback location to redirect to instead!

Data.define

In Ruby 3.2 a simple, native value object will be added to Ruby as a core class. Hello, Data. While I am not particularly thrilled about the name I am excited about the implementation, as I have found myself frequently reaching for value objects. The define method will be used to initialize an instance of this class with either positional or keyword arguments. My first thought was that this class sounded eerily similar to a Struct. However, Structs are mutable, collection-like, and dictionary-like, where Data are not. The PR for this feature is linked in the title but you can check out the proposal for it here.

Contributors:

Learn more about how The Gnar builds software.

Author headshot
Written by
, The Gnar Company

Related Insights

See All Articles
Engineering Insights
10 Ways to Get Better Results From Claude Code

10 Ways to Get Better Results From Claude Code

A recent Hacker News thread turned into a goldmine of practical advice from developers using Claude Code daily. After reading through hundreds of comments, a clear pattern emerged: the developers getting the best results aren't writing better prompts — they're building better workflows around the tool.
Engineering Insights
Anthropic Dropped OpenClaw Support. Here's How I Replaced It With Claude Code.

Anthropic Dropped OpenClaw Support. Here's How I Replaced It With Claude Code.

Anthropic's TOS change killed OpenClaw overnight, taking businesses built on the ecosystem with it. But for end users, Claude Code's new channels feature offers a viable path forward.
Product Insights
We Turned a Phone Call Into a Working Product in 48 Hours. Here's Exactly How.

We Turned a Phone Call Into a Working Product in 48 Hours. Here's Exactly How.

Watch what happens when a one-hour phone call becomes a working application in 48 hours. We walk through exactly how Context-Driven Development turns a single conversation into a competitor analysis, feature prioritization, full PRD, and production-grade software with Stripe billing, user accounts, and an admin dashboard—using AI-assisted agentic development with a human architect in the loop.
Previous
Next
See All Articles