#467 — September 12, 2019

Read on the Web

In issue 460 we included an interview with benchmarking expert Noah Gibbs. A lot of you loved how it came out.. so we're back with a new interview with Piotr Solnica of ROM and dry-rb fame! Find it at the end of the issue.

Ruby Weekly

▶  A Plan Towards Types in Ruby 3 Types — Ruby core team member Yusuke Endoh (who is famed for his prowess in the IOCCC) presents an update on progress to supporting the static analysis of types in Ruby 3, currently in a way that doesn’t hugely change the simple Ruby development experience we know and love.

Yusuke Endoh

Running GitHub on Rails 6.0 — The story of how GitHub stayed up to date with using Rails 6.0 during its development, resulting in an upgrade process that is an example to follow.

Eileen M. Uchitelle (GitHub)

What It Means to Be Remote First Versus Remote Friendly — Being a truly remote-first organization requires intentionality that spans people, tooling, and process. Product Manager Rose Jen walks us through some of the considerations when striving to build a fully inclusive distributed team.

CircleCI sponsor

A String Corruption Issue in Ruby 2.6.4 — If you didn’t upgrade to 2.6.4 yet, hold off until 2.6.5 is out! The bad news is the bug is nondeterministic and hard to reproduce. The good news is it’s fixed, but we’re awaiting releases.

Ruby Issue Tracker

▶  A Visualization of 20 Years of Ruby Development — An hour long (!), Gource-powered visualization showing the various modules of the source and the coming and going of contributors working from 1999 to now.

Landon Wilkins

The Evolution of Ruby Strings from 1.8 to 2.5 — This is an interesting diff, version on version, that ends with a look at how allocations have been affected.

Mehdi Farsi

💻 Jobs

Senior Rails Engineer, Product (Remote) — Stack: Ruby on Rails (5.2), Stimulus, Postgres & Heroku — We strive to keep our frameworks/libraries up to date. Perks: Remote team, competitive pay, meaningful company equity.

Fleetio

Find a Ruby job through Vettery — Make a free profile, name your salary, and connect with hiring managers from top employers.

Vettery

📘 Articles & Tutorials

▶  Surrounded by Ruby Microservices — The patterns and practices used at Netflix when building Rails microservices, so you’ll hear things like “ports and adapters”, “repository pattern”, and “dependency injection”. Great to see Netflix using Ruby, too.

Damir Svrtan (Netflix)

Making Friends with Rubocop — A developer shares his company’s story of how they started to rely upon Rubocop, the Ruby code analyzer.

Prathamesh Sonpatki

24/7 Hosting and Support for ROR Applications — Our team keeps your app running, you’re free to develop and release at your own pace.

Reinteractive sponsor

▶  How to Write Tests for Validations in Rails

Go Rails

Migrating From Paperclip to ActiveStorage: A Different Approach — Sortlist has hundreds of thousands of images to migrate while keeping a production app functional.

Sortlist

Using Custom Validators in Rails — A reasonably basic tip, but if you’re jamming a lot of options or regexes into your validations, it’s time to break that validation out into its own class.

Andy Croll

Understanding the next & break Keywords — There are a couple of gotchas, for sure.

Jesus Castello

How to Emulate AWS SQS for Development in a Dockerized Rails App — If you have AWS’s Simple Queue Service (or, possibly, any queue) as a dependency, this is an extremely useful tip to keep development smooth.

Ankit Samarthya

🛠 Code and Tools

Administrate: A Rails Engine for Building Flexible Admin Dashboards — Automatically generate dashboards to enable users to edit data for any model in a Rails app. This week’s release adds Rails 6 support. There’s a demo here.

thoughtbot, inc.

Maxitest: It's Minitest, Plus All The Features You Always Wanted..

Michael Grosser

Free eBook: How to Get a 3x Performance Improvement on Your Postgres Database

pganalyze sponsor

MetaTags: A SEO Helper Plugin for Rails Apps — Helpers for generating meta tags for pages in your Rails app.

Dmytro Shteflyuk

A Huge Collection of Ruby One-Liners — These aren’t new but I love coming back to these every now and then as there’s always something new to learn from these bitesize Ruby examples designed for command-line use.

Benoit Hamelin

RbNacl: Ruby Bindings to the Networking and Cryptography (NaCl) Library (a.k.a. libsodium)

Crypto.rb

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.

Piotr currently works for Theorem.