~/talk

The worst Ruby codes I've seen in my life

Talkat RubyKaigi 2015 · 2015-12-11..12-13· [ruby, developer-experience]
links:none on file
slides:none on file

Shows concrete Ruby failures: an RSpec test reveals a mask method mutates input string (credit card number changes), a Rails controller uses nested early returns and confusing success/else paths, and a DomainChecker class memoizes seven methods, creates instance of itself, parses remote JSON, depends on the view and uses a hash constructor that only reads one key — overall a tangled if/else graph. Fixes are to rewrite from scratch, separate view/validation/HTTP, replace condition trees with policies; root causes include lack of reviews and immaturity.

AI-written summary · about

  1. 0:00Introduction
  2. 1:36Masking credit cards
  3. 3:11Domain creation logic
  4. 5:26Ruby way improvements
  5. 7:25Confusing method names
  6. 10:52Domain checker class
  7. 25:25Problems with DomainChecker
  8. 28:15Fixing the DomainChecker
  9. 30:13Causes of bad code
  10. 32:33Learning from mistakes
  11. 34:10Closing remarks
~/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.