Contributions
Article
One of RSpec’s strengths is the legibility of its behavior-based DSL. But the proliferation of small example blocks introduces a performance overhead. Why? Because of RSpec lifecycle! Let’s see how we can make your RSpec tests run faster!
Article
Interacting with third-party APIs is common practice in applications. But do you prevent sprinkling calls across your codebase, duplicating logic and reinventing the wheel? This is where the structural design pattern called facade comes into play.
Article
When designing my abstractions, I’ve always had a very binary view about separating private and public behaviors. A recent gotcha got me to reconsider my practice with a little more nuance. Now, I treat my private methods as if they were public methods. No more booby-trapping my future self with hidden side-effects!
Library
A custom Jekyll command to generate og:image for new posts
Article
Hey folks, I just wrote a quick TIL on how to add extra documentation to your models attributes.
I’ve found Yard doc to be neat for public methods, but sometimes, models attributes are not super well documented. I recently had the case where we had several `duration` attributes spread across several models, and each duration had its own unit. But nowhere was it documented.
I’ve found Yard doc to be neat for public methods, but sometimes, models attributes are not super well documented. I recently had the case where we had several `duration` attributes spread across several models, and each duration had its own unit. But nowhere was it documented.
Article
Delegated types are a modelization pattern introduced in Rails in 2020. And developers have mostly been scratching their head for a few years trying to use them in their applications. Today, I want to share a real-world use case. I'll walk you through my pre-existing domain architecture, my initial requirements, my mistakes, how I eventually used delegated types, what I learned and my open questions.
Article
Don't have standards and processes for your codebase and your team? You're wasting so much cognitive energy! Let me try to convince you to pick one convention - any convention! - and move on to your core work.
Article
A few months ago, I had to write a Rails micro-service that synchronizes data between two applications. I’ll show you the successive steps I used to refactor this piece of code, from shameless-green to convention.
Article
For years, I've worked without thinking much about feature specifications. Many teams endure empty Trello cards, neglected Jira tickets, and misaligned communication. So today, I want to share how to write better specifications for your features.
Article
Today, I want to share how to test your Rails models with RSpec. Testing your models is a no-brainer strategy when building your applications. It gives you the confidence to make changes without regressions. We'll cover the fundamental testing strategies with RSpec's built-in features. And for fun, we'll check some extra tools to amp up your models' coverage.
Article
Changing careers is a long, often-overlooked process. But I want to share both the (linear) story and the (messy) history of how I became a software engineer. And like a lot of good stories, mine always starts with a lie.
Article
Feature flags are a neat way to hide in-progress features from your users. For those who need a simple on-and-off system, here's a minimal feature flag manager that'll take less than an hour to build, using plain Ruby objects, the Rails configuration, and some neat variables organization.
Article
Classes depend on each other all the time. But the way you tie those classes together will determine how hard it is to change your code. Dependency injection can help you reduce that coupling and reduce your cost of change.
Article
You're about to upgrade your application to the newest version of Ruby on Rails. And you've never done it before? Fear not! Here's my battle-tested companion to migrating Rails.
Article
Working on large features can be tricky. I’ve spent the last few months refining a process that makes it easy to keep in touch with the main branch, to make reviews more manageable, and with little GIT overhead.
Article
After writing about RSpec's setup and its basic structure, I thought it'd be useful to explore the methods you’ll use the most when testing with RSpec.
Article
When you start programming, it’s not easy to know what to test, how to test, and why should you test? This first post about RSpec fundamentals will be part of a larger series explaining various aspects of testing with RSpec.
Article
The more you learn, the more debugging becomes complex. So I've decided to write a short recap on some cool features offered by pry-byebug: moving in the stack frame, adding breakpoints on the fly, aliases, etc.
Tutorial
So for those of you who can’t wrap their head around `pry-byebug` debugger, I wrote a hands-on tutorial that’ll walk you through its most basic commands.
You’ll learn how to:
⏸ Pause code execution
🆕 Get current values
You’ll learn how to:
⏸ Pause code execution
🆕 Get current values