~/talk

Refactoring Live: Primitive Obsession

Talkat RailsConf 2019 · 2019-05-01..05-03· [developer-experience]
slides:none on file

Live refactoring of a Rails app untangles Primitive Obsession by replacing string grades with a Grade value object, adding a Grade.for factory to accept either strings or objects, implementing Comparable via the spaceship operator to compare scores, and moving score logic off Transcript into Grade. ActiveRecord fields serialize to Grade with ActiveRecord serialize methods, tests run with guard + RSpec, specs stay green and adding plus/minus grades and an assistant role becomes two-line changes.

AI-written summary · about

  1. 0:00Intro
  2. 0:37What is refactoring
  3. 2:07How to refactor
  4. 5:49Demo
  5. 11:38Adding a grade class
  6. 13:38Converting values to objects
  7. 15:43Updating calls to new
  8. 18:15Grades
  9. 21:08Converting Strings to Grades
  10. 23:49Changing the Contract of Grade
  11. 25:21Making Improvements to Grades
  12. 27:08Comparing Grades
  13. 29:28Updating Grades
  14. 30:14Updating Roles
  15. 36:30Conclusion
~/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.