Piotr is serious about Ruby and open source. In fact, you can sponsor his awesome work on GitHub, which is something we strongly encourage. We're exceedingly grateful that Piotr took some time to answer our questions this week.
What inspired you to become such a productive open source contributor in Ruby?
Scratching my own itch is probably my biggest inspiration. I always look for existing solutions and when I don't see anything that would satisfy my requirements, I just go ahead and build my own solution. I also spent a lot of time fixing other people's problems, which was a great source of inspiration too. Talking to people is also very inspiring - especially when it happens in the real world. Every time I go to a conference I meet people who use some of the gems I built or help maintain and talking about their experiences (whether bad or good!) motivates me to keep going.
Do you ever use Active Record?
No. I've learned over time that it's a very bad pattern. These days I'm anti-ORM in general and, for me, Active Record is the worst of all the popular ORM patterns. I used to think it's great for simple apps, but the more I worked with rom-rb, the more I realized you can be as productive as with Active Record, yet you have a much better foundation for scaling your code (in terms of both complexity and performance).
I think ditching ORMs is one of the best things programming communities could do. Unfortunately in the case of the Ruby community it's especially hard because of the widespread adoption of the Active Record pattern.
What is your Ruby web app toolset of choice?
I use a mixture of dry-rb and rom-rb libraries, which is probably not a surprise to anybody who knows me 🙂 I try to avoid Rails, but even when I am forced to use it, I can still plug in at least some dry-rb gems and things become better for me. For routing I still use Roda, even though I'm no longer a fan of the routing tree concept.
My dream-stack in Ruby will be Hanami 2.0 though - that's why I started helping with this effort. More specifically - rom-rb for anything database-related, dry-schema for handling HTTP params, dry-validation for complex domain validation, dry-monads for control-flow and Hanami for routing and glueing everything together.
What excites you most about Ruby's future?
Two things: First, a bigger focus on concurrency, because pretty much all of the gems I've been working on since roughly 2014 focused on, amongst many other things, thread-safety and making it easier to write concurrent code in Ruby. I've already built a couple of PoCs using rom-rb and some dry-rb gems just to see how concurrent processing could be leveraged and it looked very promising. If we can achieve better performance by writing concurrent code using MRI, then you'll be able to benefit from dry-rb/rom-rb a lot. It seems like all of that is around the corner.
Secondly, it looks like Ruby core team started paying more attention to the functional aspects of the language. We see features like pattern matching or proc composition operator being added or discussions about adding immutable structs. This is very exciting for me given that I've spent 5+ years convincing people that moving away from classic OO, even when you use Ruby, is one the best things you can do to make your code better.