~/talk

Writing Small Code

Talkat RailsConf 2014 · 2014-04-22..04-25· [ruby, developer-experience]
slides:none on file

Builds a small Ruby command‑line option parser that starts with booleans then adds strings integers and arrays, keeping TDD and specs green the whole time. Uses concrete refactorings — extract method and extract class — plus dynamic instantiation by naming convention and dependency inversion so CommandLineOptions becomes a thin coordinator. Shows numbers: one class shrinks from ~31 lines to a 28‑line coordinator while option subclasses handle the complexity, and the resulting design works and extends without changing the coordinator.

AI-written summary · about

  1. 0:00Start
  2. 6:07The Goal
  3. 6:28Extract Method Refactoring
  4. 6:49Command Line Option Parser
  5. 11:44First Rule of Method of Methods
  6. 14:24Extract Method Refactor
  7. 16:24Magic Constants
  8. 20:15How Do We Write Small Classes
  9. 23:32Conditional Statements
  10. 27:23Dependency Inversion
~/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.