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
1
400
Don't Get Clever
Part of the Ruby Rogues live panel episode at Lone Star Ruby Conference 2013.
avdi
July 20, 2013
Tweet
Share
More Decks by avdi
See All by avdi
Pairing is Caring
avdi
2
500
Code to Joy
avdi
10
1.6k
Building Gems that Don't Suck
avdi
4
560
Making Little Classes out of Big Ones
avdi
29
3.3k
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
790
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
820
Building Flexible Design Systems
yeseniaperezcruz
328
39k
GraphQLとの向き合い方2022年版
quramy
49
14k
A Tale of Four Properties
chriscoyier
160
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Optimizing for Happiness
mojombo
379
70k
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Navigating Team Friction
lara
189
15k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
900
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