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
470
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
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
190
Git: the NoSQL Database
bkeepers
PRO
432
67k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
880
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
RailsConf 2023
tenderlove
30
1.5k
Tell your own story through comics
letsgokoyo
1
1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
500
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
Fireside Chat
paigeccino
42
4k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
The Limits of Empathy - UXLibs8
cassininazir
1
540
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.7k
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