Blog

Duck typing vs type safety in Ruby

November 02, 2016 by Piotr Solnica

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...


Invalid Object Is An Anti-Pattern

December 28, 2015 by Piotr Solnica

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...


Introducing dry-validation

December 07, 2015 by Piotr Solnica

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...


Ditch Your ORM

September 18, 2015 by Piotr Solnica

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...