#469 — September 26, 2019

Read on the Web

📣 This week we've got another interview for you — check out the bottom of the issue.

Ruby Weekly

▶  The Journey to One Million — A talk from RubyConf Taiwan 2019 all about improving Ruby and making it more scalable, particularly in the context of concurrency and network I/O and being able to handle one million WebSocket connections simultaneously.

Samuel Williams

FriendlyId: Human-Friendly Slugs and Permalinks for Active Record — v5.3.0, the first release in almost a year, is out. FriendlyId lets you do things like manage slug history and versioning, i18n, scoped slugs, and more.

Norman Clarke

Get More Out of Your Postgres Database — pganalyze summarized their learnings on how to get a 3x performance improvement on their Postgres database. Lots of helpful best-practices.

pganalyze sponsor

Chef's Contract with ICE Causes Gem Yanking Controversy — Chef is a popular Ruby-based infrastructure automation system. The company behind it was found to have entered into a contract with the United States’ Immigration and Customs Enforcement agency. In protest, the developer of chef-sugar yanked his code and gems. Chef has since decided to not renew the contract but has also claimed ownership of the related gems on RubyGems.org.

The Register

Fail Fast and Fail Often: Handling API Errors at Scale — What do you do when 100,000 Sidekiq jobs fail every day? If at first you don’t succeed, retry, retry again.

Akshay Nathan

Puma 4.2 Released: A Rack Web Server Built for Concurrency — A popular, long standing, reactor-based Ruby/Rack web server. Release notes.

Puma

💻 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 — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

📘 Articles & Tutorials

For Organizing Rails Projects, 'Domain Objects are Good and Service Objects are Bad' — Service objects (or the Interactor pattern) are popular in Ruby/Rails circles. Should they be? Jason doesn’t think so and shows off some refactoring here.

Jason Swett

Ruby 2.7 Adds Integer#[] to Support Range Values — It’ll let you access a range of bits within the binary representation of the integer. As a bit twiddler myself, this is great, but I’m surprised it made it in.

Romil Mehta

Behind-the-Scenes of 'Geared Pagination' in Rails — A dive inside the geared_pagination gem which was written by DHH. The idea of geared pagination is that the number of records shown is based on a ratio to the page number.

Liroy Leshed

10 Lessons Learnt From The 'Tennis Game' Refactoring Kata — Katas are a great way to practice refactoring, as is watching someone else mercilessly refactor their code.

Andrzej Krzywda

▶  How to Use Devise Test Helpers — If you’re using Devise for authentication, did you know it provides helpers to make testing its controllers easier?

GoRails

Automated Code Reviews for Ruby — Set standards on coverage, duplication, complexity, and style issues and see real-time feedback in your Git workflow.

Codacy sponsor

Ruby Templating: Baking an Interpreter — This final post in a three-part series covers using the Visitor Pattern to render the templates.

Benedikt Deicke

Using Vim for Ruby and Rails Development in 2019 — The trickiest thing about using Vim can be just getting going. This article goes from zero to fully functional IDE to get you over the hump.

Vim from Scratch

▶  Discussing How to Build a Consulting Business — This isn’t Ruby specific, but consulting is popular in our space and Test Double is a Rails shop, so..

Ruby Rogues Podcast podcast

Flaky Ruby Tests — We’ve all had them. Tests that pass sometimes and fail others. Dan’s approach to address (not fix) the issue is a good study in making flaky tests a bit better.

Dan Mayer

Rails 6 Adds add_foreign_key & remove_foreign_key for SQLite3

Amit Choudhary

🛠 Code and Tools

Chewy: A High-Level Elasticsearch Framework — An ODM and wrapper for working with Elasticsearch in a more idiomatically Ruby, developer-friendly way (check out the code examples).

Toptal

Erubi: A Small, Alternative ERB Implementation

Jeremy Evans

Instantly Know When Ruby Errors Occur & How to Fix Them

Rollbar sponsor

childprocess: Cross-Platform Library for Managing Child Processes

Eric Kessler

Rubyzip: A Library for Working with .zip Files — Create zip archives, open them up, add password protection..

The Rubyzip Team

Faker 2.4: A Library for Generating Fake Data — The popular ‘fake’/dummy data generator continues to improve. It now has a generator for Aeternity blockchain values.

Faker

Bozhidar is the VP of Engineering at Toptal and is a driving force around RuboCop and the Ruby Style Guide. He has also started writing about the weird things he's found in Ruby.

What is the weirdest thing you've ever seen in Ruby?

It's hard to pick just one thing as I've bumped into dozens and dozens of weird aspects of Ruby (and I still encounter new things to this day). One of my personal favourites is that defined? returns all sorts of things except actually a boolean value. Most recently I was amused to discover you could nest heredocs (that look super weird!) and by this difference in the behaviour of regular conditionals and modifier conditionals.

Who is the 'weirdest' Rubyist you know (in a good way)?

That's a simple question - my good friend Nick Sutterer, of Trailblazer fame. His vision for the future of Ruby is pretty bold and many people have considered it to be extra 'weird'. I really think our community needs more people like Nick who are constantly challenging the established rules and norms and are trying existing problems in novel ways (e.g. his ideas for adding real namespaces to Ruby).

What is the weirdest request you've received for the Ruby Style Guide?

There are a lot of strong contenders for the title, but I'll go with this, which was trying to make the case that it's a bad idea to use _ as a thousands separator.

Every now and then someone will suggest we start discouraging some universally adopted practice or start promoting something weird and I guess that's not a bad thing. I have a feeling that the most weird requests ended up in RuboCop's issue tracker though, as every now and then I'd get the request there to add support for a very peculiar coding style that I've never encountered in my entire career with Ruby. With great flexibility comes a lot of potential for weirdness!

Bozhidar works for Toptal.