job is awesome • Remotely pairing with many different people • Different levels of knowledge, different problems to solve Avdi Grimm (ShipRise) GoGaRuCo 2012 3 / 50
job is awesome • Remotely pairing with many different people • Different levels of knowledge, different problems to solve • ”That’s so cool, I didn’t know you could do that” Avdi Grimm (ShipRise) GoGaRuCo 2012 3 / 50
through the Ruby language and standard library. . . • . . . stopping in at some of my favorite idioms and tools. . . Avdi Grimm (ShipRise) GoGaRuCo 2012 6 / 50
through the Ruby language and standard library. . . • . . . stopping in at some of my favorite idioms and tools. . . • . . . and around the world, in postcards! Avdi Grimm (ShipRise) GoGaRuCo 2012 6 / 50
values from a method. . . • . . . *Or* a single result object. . . • . . . from the same line of code. Magic! Avdi Grimm (ShipRise) GoGaRuCo 2012 19 / 50
2 repo = PStore.new( ’blog.pstore’ ) repo.transaction do 4 # ... end • Faster Adding 1000 posts, with a transaction for each write: user system total real yaml 50.210000 0.210000 50.420000 ( 54.024277) pstore 3.290000 0.130000 3.420000 ( 10.887887) Avdi Grimm (ShipRise) GoGaRuCo 2012 25 / 50
mechanism • Great for local command-line apps • Supports complex object trees • Oh yeah, one more thing. . . Avdi Grimm (ShipRise) GoGaRuCo 2012 26 / 50
we want to capture a name? result = nil result = names do |name| if name =~ /^S/ result = name break end end result # => "Shifra" Avdi Grimm (ShipRise) GoGaRuCo 2012 37 / 50
names do |name| break name if name =~ /^S/ end result # => "Shifra" This effectively overrides the method’s return value. Avdi Grimm (ShipRise) GoGaRuCo 2012 37 / 50
open( ’code-to-joy.org’ ) result = f.lines.detect do |line| break "<Line Not Found>" if f.lineno >= 100 line =~ /banana/ end result # => "<Line Not Found>" Avdi Grimm (ShipRise) GoGaRuCo 2012 38 / 50
Character < SimpleDelegator def initialize(name, race, char_class) @name = name super(race) end # ... end Only one object supported. Avdi Grimm (ShipRise) GoGaRuCo 2012 44 / 50
new “kind” of module • Enables us to add state to the modules a class includes • Enabled us to implement a new type of message delegation in Ruby Avdi Grimm (ShipRise) GoGaRuCo 2012 46 / 50
debt got you down? • Community drama bumming you out? • If you’re blue, don’t know where to go to. . . • . . . practice joyful coding Avdi Grimm (ShipRise) GoGaRuCo 2012 48 / 50
debt got you down? • Community drama bumming you out? • If you’re blue, don’t know where to go to. . . • . . . practice joyful coding • How? Avdi Grimm (ShipRise) GoGaRuCo 2012 48 / 50
metric for joyful code • Shared code is joyful code • If you want to feel good about your craft. . . • . . . give someone a “wow” moment. Avdi Grimm (ShipRise) GoGaRuCo 2012 49 / 50
metric for joyful code • Shared code is joyful code • If you want to feel good about your craft. . . • . . . give someone a “wow” moment. • Show one person something awesome. Avdi Grimm (ShipRise) GoGaRuCo 2012 49 / 50
metric for joyful code • Shared code is joyful code • If you want to feel good about your craft. . . • . . . give someone a “wow” moment. • Show one person something awesome. • I promise you’ll feel better! Avdi Grimm (ShipRise) GoGaRuCo 2012 49 / 50