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
460
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
570
Code to Joy
avdi
10
1.8k
Building Gems that Don't Suck
avdi
4
620
Making Little Classes out of Big Ones
avdi
29
3.4k
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
170
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
600
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
220
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
230
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
240
Building AI with AI
inesmontani
PRO
1
1.1k
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