Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JLS myths ~ if-then-else statement ~
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
HASUNUMA Kenji
October 01, 2016
Programming
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JLS myths ~ if-then-else statement ~
HASUNUMA Kenji
October 01, 2016
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
76
Life of our small product
khasunuma
0
54
How to adapt MicroProfile API for generic Web applications
khasunuma
0
57
Overviewing Admin Console
khasunuma
0
52
Introduction to MicroProfile Metrics
khasunuma
0
84
Basic method for Java EE Web Profile
khasunuma
0
55
Introduction to JCA and MDB
khasunuma
0
110
Collections Framework Begineers Guide 2
khasunuma
0
120
Introduction to Date and Time API 4
khasunuma
0
110
Other Decks in Programming
See All in Programming
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
130
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.5k
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
590
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
golang-bob.pdf
iwatsukayura
0
140
Railsバージョンを4倍にした話
optim
0
740
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
AmebaブログはKMPから卒業します
kmars0605
0
240
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
1k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
970
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.7k
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.4k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
470
How to Ace a Technical Interview
jacobian
280
24k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
RailsConf 2023
tenderlove
30
1.6k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Marketing to machines
jonoalderson
1
5.9k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
440
Believing is Seeing
oripsolob
1
250
Transcript
JLS myths ~ if-then-else statement ~ HASUNUMA Kenji
[email protected]
GlassFish
Users Group Japan
if-else statement if ( someObject.eval() ) if ( otherObject.eval() )
func1(); else func2(); assume that someObject.eval() is false. which is run, func1 or func2?
if-else statement if ( someObject.eval() ) if ( otherObject.eval() )
func1(); else func2(); assume that someObject.eval() is false. Neither func1 nor func2 is run.
if-else statement if ( someObject.eval() ) if ( otherObject.eval() )
func1(); else func2(); It's if-else's short-circuit. Don't be misled by source code format!
From JLS (Java SE 8) IfThenStatement: if ( Expression )
Statement IfThenElseStatement: if ( Expression ) StatementNoShortIf else Statement IfThenElseStatementNoShortIf: if ( Expression ) StatementNoShortIf else StatementNoShortIf
Statement Statement: StatementWithoutTrailingSubstatement LabeledStatement IfThenStatement IfThenElseStatement WhileStatement ForStatement
StatementNoShortIf StatementNoShortIf: StatementWithoutTrailingSubstatement LabeledStatementNoShortIf IfThenElseStatementNoShortIf WhileStatementNoShortIf ForStatementNoShortIf *** 'IfThenStatementNoShortIf' don't
exist ***
if-else statement (fixed) if ( someObject.eval() ) { if (
otherObject.eval() ) func1(); } else func2(); assume that someObject.eval() is false. which is run, func1 or func2?
if-else statement (fixed) if ( someObject.eval() ) { if (
otherObject.eval() ) func1(); } else func2(); func2 is run! because it use block as statement in outer if statement
JLS myths ~ If-then-else statement ~ HASUNUMA Kenji
[email protected]
GlassFish
Users Group Japan