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
280
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
370
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
CSC307 Lecture 06
javiergs
PRO
0
270
えにしテック、あるいは人間関係のエクササイズ / #enishitech-15th-anniv
kakutani
7
2.9k
タクシーアプリ『GO』を運営する中発生した様々な失敗例の紹介
mot_techtalk
9
5.5k
アーキテクチャレベルで考える開発生産性 / architecture-and-productivity
minodriven
18
7.3k
CSC307 Lecture 03
javiergs
PRO
0
170
アプリケーションをリプレイスしたら チームとサービス運用に向き合えた
kazatohiei
1
340
[Flutter] Unitテストの基礎を理解する
haruki_uiru
0
210
【Go言語】ジェネリクス
tomo1227
0
130
IaCにおけるテスト考察 / Tests in IaC
linyows
2
260
凝集性から考えるLaravelのmiddleware、routingに書くか? Policyに書くか?
newnomad
1
180
初心者がおさえておきたいAWS CDKのベストプラクティス 2024
konokenj
10
4k
ドラ🔵もんでDIを学ぶ
tomo1227
0
4.9k
Featured
See All Featured
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Raft: Consensus for Rubyists
vanstee
133
6.4k
Music & Morning Musume
bryan
43
5.8k
Large-scale JavaScript Application Architecture
addyosmani
506
110k
The Pragmatic Product Professional
lauravandoore
28
6k
Docker and Python
trallard
36
2.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
9k
Building Effective Engineering Teams - LeadDev
addyosmani
42
2.1k
GitHub's CSS Performance
jonrohan
1025
450k
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.7k
A Philosophy of Restraint
colly
199
16k
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