Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Don't Get Clever
Search
avdi
July 20, 2013
440
1
Share
Don't Get Clever
Part of the Ruby Rogues live panel episode at Lone Star Ruby Conference 2013.
avdi
July 20, 2013
More Decks by avdi
See All by avdi
Pairing is Caring
avdi
2
540
Code to Joy
avdi
10
1.8k
Building Gems that Don't Suck
avdi
4
610
Making Little Classes out of Big Ones
avdi
29
3.3k
Featured
See All Featured
The browser strikes back
jonoalderson
0
990
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
500
Tell your own story through comics
letsgokoyo
1
900
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
Skip the Path - Find Your Career Trail
mkilby
1
110
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
130
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Everyday Curiosity
cassininazir
0
200
Site-Speed That Sticks
csswizardry
13
1.2k
Building AI with AI
inesmontani
PRO
1
930
Navigating Weather and Climate Data
rabernat
0
170
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
520
Transcript
Don't Get Clever Avdi Grimm
Pop quiz r e q u i r e '
p s t o r e ' s t o r e = P S t o r e . n e w ( ' d a t a . p s t o r e ' ) s t o r e . t r a n s a c t i o n ( t r u e ) d o # . . . e n d
Pop quiz 2 A r r a y . i
n s t a n c e _ m e t h o d s ( f a l s e )
Symbols are truthy r e q u i r e
' p s t o r e ' s t o r e = P S t o r e . n e w ( ' d a t a . p s t o r e ' ) s t o r e . t r a n s a c t i o n ( : r e a d _ o n l y ) d o # . . . e n d
Clever!
What's : r e a d _ o n l
y ?? s t o r e . t r a n s a c t i o n ( : r e a d _ o n l y ) d o # . . . e n d
Dead end s t o r e . t r
a n s a c t i o n ( : c h u n k y _ b a c o n ) d o # . . . e n d
Negation A r r a y . i n s
t a n c e _ m e t h o d s ( ! : i n c l u d e _ s u p e r )
Don't get clever
Intention-revealing argument r e a d _ o n l
y = t r u e s t o r e . t r a n s a c t i o n ( r e a d _ o n l y ) d o # . . . e n d
Intention-revealing argument i n c l u d e _
s u p e r = f a l s e A r r a y . i n s t a n c e _ m e t h o d s ( i n c l u d e _ s u p e r )
Inline version A r r a y . i n
s t a n c e _ m e t h o d s ( i n c l u d e _ s u p e r = f a l s e )
Don't get clever