← Graph

To Refine or Not to Refine

talk 13 connections

Lightning talk at wroclove.rb 2018 surveying Ruby refinements. History: introduced in Ruby 2.0 as experimental (limiting adoption), no longer experimental since 2.1 but still distrusted due to early bugs. Based on an interview with Akira Matsuda two years prior: refinements were authored by Shugo Maeda; originally more powerful but features were cut due to JRuby implementation complexity; Koichi Sasada (incremental/generational GC work) is the one core member who wants to remove them, so their future remains uncertain. Use cases where refinements fit well: dependency reduction (speaker's refinement emulating ActiveSupport core extensions to drop the dependency), coordinated modernization (polyfill Ruby 2.5's Hash#fetch without bumping the gem's required Ruby version, delete the refinement later), 'perfect privacy' (make `private` actually unreachable via `send`), scoping DSLs so a gem's syntax sugar (e.g. a lambda-to-Proc converter) only pollutes the one file that opts in, and inspecting ActiveRecord-style models included via `using`. Notes Sequel has a refinement mode instead of monkey patching, and that a Rails-5-era patch by Akira Matsuda using refinements was rolled back. Flags ongoing API quirks (a refinement activates under `send` but not `public_send`), JRuby implementation differences, and points to TruffleRuby's support for refinements as a sign they will stay in the language. Closes with a plug for the speaker's 'gemcheck' project — a checklist plus curated tool list (documentation, linting) for gem authors to write better software for other developers.

type
lightning-talk
talk To Refine or Not to Refine
about
Refinements concept
Primary subject of the talk.
talk To Refine or Not to Refine
about
Akira Matsuda person
References an interview with Akira Matsuda about refinements.
talk To Refine or Not to Refine
about
Shugo Maeda person
Identifies Shugo Maeda as author of refinements.
talk To Refine or Not to Refine
about
Koichi Sasada person
Mentions Koichi Sasada as wanting to remove refinements.
talk To Refine or Not to Refine
about
Example of replacing an ActiveSupport dependency with a refinement.
talk To Refine or Not to Refine
about
Sequel tool
Cites Sequel's refinement mode as an example.
talk To Refine or Not to Refine
about
Mentions a Rails 5-era refinements patch rolled back.
talk To Refine or Not to Refine
about
gemcheck project
Talk closes with a plug for the speaker's gemcheck checklist project.
talk To Refine or Not to Refine
about
Mentions TruffleRuby's refinement support as evidence refinements are here to stay.
from_talk
To Refine or Not to Refine talk
First recommended use case in the talk.
from_talk
To Refine or Not to Refine talk
Second recommended use case in the talk.
talk To Refine or Not to Refine
presented_at
Lightning talk on Ruby refinements.
talk To Refine or Not to Refine
related_to
Notes JRuby implementation differences sometimes require workarounds when using refinements.

Provenance

Created in
Wroclove.rb 2018 — Lightning Talks 2026-04-17 16:18
Read by
27 extractions