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
One Line If
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Vinicius Gomes
July 01, 2014
Programming
360
0
Share
One Line If
Based on this blog post:
http://vvgomes.com/one-line-if/
Vinicius Gomes
July 01, 2014
More Decks by Vinicius Gomes
See All by Vinicius Gomes
Golpes e Fraudes Bancárias
vvgomes
0
54
Monitoramento de SEO com Cloud Functions
vvgomes
0
48
Thinking Event Driven Architectures with Serverless
vvgomes
0
1.9k
Quando Microserviçoes Encontram Event Sourcing
vvgomes
0
290
Arquitetura Orientada a Eventos no mundo Serverless
vvgomes
0
440
When Microservices Meet Event Sourcing
vvgomes
6
1.3k
When Microservices met Event Sourcing
vvgomes
1
600
Feature Leads
vvgomes
1
840
As Melhores Práticas na Condução de Entrevistas Técnicas
vvgomes
0
680
Other Decks in Programming
See All in Programming
Vibe NLP for Applied NLP
inesmontani
PRO
0
430
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
130
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
550
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
Swift Concurrency Type System
inamiy
0
530
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
780
実用!Hono RPC2026
yodaka
2
220
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
6.5k
t *testing.T は どこからやってくるの?
otakakot
1
620
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
940
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
460
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2k
The Limits of Empathy - UXLibs8
cassininazir
1
300
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
160
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Speed Design
sergeychernyshev
33
1.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
330
4 Signs Your Business is Dying
shpigford
187
22k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
170
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
440
Transcript
one line if
Why? • Improve reading effectiveness • Improve maintenance
Motivation • Cyclomatic complexity • Mental stack limitations
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
None
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } }; hit
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } };
this.guess = function(letter) { if(hiddenWord.reveal(letter)) { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You
Kick Asses!'); nextLevel(); } } else { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } } }; mistake
this.guess = function(letter) { if(hiddenWord.reveal(letter)) hit(); else mistake(); }; var
hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } }; win
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) { alert('You Kick Asses!'); nextLevel(); } }; var mistake = function() { image.showNext(); if(--chances == 0) { alert('Looooser!'); gameOver(); } }; lose
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); if(hiddenWord.isEverythingRevealed()) win(); }; var mistake = function() { image.showNext(); if(--chances == 0) lose(); }; var win = function() { alert('You Kick Asses!'); nextLevel(); }; var lose = function() { alert('Looooser!'); gameOver(); };
this.guess = function(letter) { hiddenWord.reveal(letter) ? hit() : mistake(); };
var hit = function() { hiddenWord.render(); win.when(hiddenWord.isEverythingRevealed()); }; var mistake = function() { image.showNext(); lose.when(--chances == 0) }; var win = function() { alert('You Kick Asses!'); nextLevel(); }; var lose = function() { alert('Looooser!'); gameOver(); };
None