~/talk

This or that? Similar methods & classes in Ruby && Rails

Talkat RailsConf 2024 · 2024-05-07..05-09· [ruby-on-rails]
links:none on file
slides:none on file

Benchmarks on Ruby 3.3.0 compare many concrete alternatives: cover vs include shows cover ~2x faster on small ranges and massively faster on huge string ranges because include builds members; regular expression choices reveal regex side effects—match? is fastest and doesn’t set Perl globals, ~= and others do; NotImplementedError subclasses ScriptError so generic rescue doesn’t catch it; delegation can generate methods from lambdas but defining is ~146x slower and calling ~7x slower; eval-based tricks are ~281x slower; repo of tests and examples exists.

AI-written summary · about

  1. 0:00Method vs class differences
  2. 5:51Range cover versus include methods
  3. 10:48Regex matching options
  4. 16:06NoMethodError vs NotImplementedError
  5. 18:33Monkey patching vs define_method
  6. 21:45Delegation in Ruby/Rails
  7. 28:49Calling methods creatively
  8. 35:07Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.