Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RubyRogues Panel - Naming Things

RubyRogues Panel - Naming Things

Implementation is different from intent. Code is more readable when it tells the story of the problem rather than the details of the solution.

Katrina Owen

August 07, 2013
Tweet

More Decks by Katrina Owen

Other Decks in Programming

Transcript

  1. class Bob def hey(s) if s == s.upcase "Woah, chill

    out!" else "Whatever." end end end
  2. class Bob def hey(s) if all_caps?(s) "Woah, chill out!" else

    "Whatever." end end def all_caps?(s) s == s.upcase end end
  3. class Bob def hey(s) if shouting?(s) "Woah, chill out!" else

    "Whatever." end end def shouting?(s) s == s.upcase end end