GitHub Sponsorship

GitHub has recently started their Sponsors program and I was lucky to get an invite pretty early on when it’s still in a closed beta phase. I received the invite on August 30th and it took me exactly one month to finally fill out my profile and get it published. I’m saying “finally” because even though I knew I wanted to try it out, it was not immediately obvious to me how exactly I want it to work in my case....

September 4, 2019 · 6 min · Peter Solnica

Introducing dry-schema

Two years ago (!!!) I published a post on discourse.dry-rb.org explaining my plans for dry-validation 1.0.0 and in this post I mentioned that there will be a new gem called dry-schema that dry-validation will use for its schemas. It’s crazy how time flies because I swear I thought it was last year. I know that over this time dry-validation has been accumulating a lot of issues (125 in the moment of writing this article), and I know it sucks, big time, that I didn’t have a chance to address any of these....

January 31, 2019 · 6 min · Peter Solnica

A quick​ recap and plans for the future

Hi, I’m back! I haven’t written anything on this blog since November 2016, which is sad but it is what it is. I’ve got so much to tell you. A lot happened during this time, and I’ll try to summarize it here and also talk a bit about my plans for the future. The Ruby Prize Almost a year ago I was honored to go to Matsue, Japan, to attend the Ruby World 2017 conference, where I received the Ruby Prize from Matz himself....

August 29, 2018 · 7 min · Peter Solnica

Duck typing vs type safety in Ruby

Duck typing is one of the virtues of the Ruby language, it adds a lot of flexibility to the code, and allows us to use objects of different type in places where only specific methods are needed. Even though the idea behind duck typing may seem to be straight-forward, it is easy to use it incorrectly. It’s interesting to notice that over many years we’ve adopted various techniques that seem to leverage duck typing, but the specifics of how exactly we’re doing it are actually questionable, and I believe they deserve some reconsideration....

November 2, 2016 · 6 min · Peter Solnica

Abstractions and the role of a framework

This is a follow-up to the discussion that was started last week after I published “My time with Rails is up”. Since this article received a lot of feedback, over 1000 comments on various sites and even more tweets, despite my greatest efforts, I didn’t manage to reply to everything. Many people were confused about some of the arguments, as I didn’t do a good job at providing proper context and making certain things clearer....

May 30, 2016 · 7 min · Peter Solnica

My time with Rails is up

Please also read my follow-up about abstractions and the role of a framework Last year I made a decision that I won’t be using Rails anymore, nor I will support Rails in gems that I maintain. Furthermore, I will do my best to never have to work with Rails again at work. Since I’m involved with many Ruby projects and people have been asking me many times why I don’t like Rails, what kind of problems I have with it and so on, I decided to write this long post to summarize and explain everything....

May 22, 2016 · 23 min · Peter Solnica

Invalid Object Is An Anti-Pattern

The idea of an object that validates its own state has been made very popular by Rails’ ActiveRecord. We can see this pattern in many places, not only in ORM libraries but in many other gems whenever some sort of validation is needed. Have you ever thought about why we’re allowing invalid state just to…validate data? It doesn’t seem to be a good idea, in fact, it feels like a huge anti-pattern....

December 28, 2015 · 4 min · Peter Solnica

Introducing dry-validation

We started experimenting with a new validation library under dry-rb organization a couple of months ago, and last month I released the first version of dry-validation. Since then I worked hard on improving it and adding support for i18n. Today, I released dry-validation 0.3.0 with a couple of bug fixes, new features and a complete support for i18n. Before I tell you what it is and how it can help you, let me start by explaining the reasoning behind this project....

December 7, 2015 · 8 min · Peter Solnica

Ditch Your ORM

I’ve been promoting a functional approach in Ruby for a while now and even though it includes many different techniques and patterns, there’s this one idea, one fundamental idea that changes everything - immutability. But what does it even mean in Ruby? To freeze everything? That would be too slow, so no. Immutability-oriented design means that you avoid interfaces that can change your objects. Yes, there are plenty of methods in Ruby to mutate something, but when you are designing your object interfaces, you can design them in a way that your objects won’t change....

September 18, 2015 · 7 min · Peter Solnica

Encapsulating Business Transactions With Transflow

It’s a known fact that when you deal with a big problem it’s good to split it into smaller problems, solve them in isolation using separate components and use an integration layer to combine them into a single unit. Unfortunately it’s easier said than done. In an OO language like Ruby there are countless approaches you can take to tackle complex scenarios in your application. Objects accumulating state, which gets mutated as a result of some business transaction, is already a complex thing to deal with....

August 17, 2015 · 5 min · Peter Solnica