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
Vinicius Gomes
July 01, 2014
Programming
0
290
One Line If
Based on this blog post:
http://vvgomes.com/one-line-if/
Vinicius Gomes
July 01, 2014
Tweet
Share
More Decks by Vinicius Gomes
See All by Vinicius Gomes
Golpes e Fraudes Bancárias
vvgomes
0
27
Monitoramento de SEO com Cloud Functions
vvgomes
0
25
Thinking Event Driven Architectures with Serverless
vvgomes
0
1.8k
Quando Microserviçoes Encontram Event Sourcing
vvgomes
0
240
Arquitetura Orientada a Eventos no mundo Serverless
vvgomes
0
380
When Microservices Meet Event Sourcing
vvgomes
6
1.2k
When Microservices met Event Sourcing
vvgomes
1
520
Feature Leads
vvgomes
1
670
As Melhores Práticas na Condução de Entrevistas Técnicas
vvgomes
0
540
Other Decks in Programming
See All in Programming
わかりやすい正解を捨てて、コトに向き合う - スクラムフェス金沢2024 スポンサーセッション
yusukekokubo
0
170
Namespace on read
tagomoris
2
370
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
[After Kotlin Fest 2024 LT Night @ Sansan] もっともっとKotlinを好きになる!K2 Compiler Pluginで遊んでみよう!
kitakkun
2
260
「2024年版 Kotlin サーバーサイドプログラミング実践開発」の補講 〜O/Rマッパー編〜
n_takehata
2
260
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
140
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
開発部に不満を持っていたCSがエンジニアにジョブチェンしてわかった「勝手に諦めない」ことの大切さ
sakuraikotone
28
16k
Activities at Cairo Library
cairolibrary720
0
1.2k
Prompt FlowによるLLMアプリケーション開発
yuto2000
1
1k
CSC307 Lecture 09
javiergs
PRO
1
500
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
250
Featured
See All Featured
WebSockets: Embracing the real-time Web
robhawkes
59
7.2k
Done Done
chrislema
179
15k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
121
18k
Fontdeck: Realign not Redesign
paulrobertlloyd
79
5.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
248
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
18
1.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
90
47k
Adopting Sorbet at Scale
ufuk
71
8.8k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
277
13k
Designing on Purpose - Digital PM Summit 2013
jponch
113
6.6k
A better future with KSS
kneath
231
17k
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