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
Trap Questions in Java and Obj-C
Search
417.72KI
December 03, 2019
Programming
1
270
Trap Questions in Java and Obj-C
417.72KI
December 03, 2019
Tweet
Share
More Decks by 417.72KI
See All by 417.72KI
iTunes・おぼえていますか〜ScriptingBridge今昔物語〜
417_72ki
1
23
The history of entry-point in iOS app Development
417_72ki
0
360
R.swift to Asset Symbols
417_72ki
0
250
Refactor with using `available` and `deprecated`
417_72ki
3
600
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
390
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
890
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.5k
Mockable UserDefaults with Duck typing
417_72ki
0
830
Other Decks in Programming
See All in Programming
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
受け取る人から提供する人になるということ
little_rubyist
0
230
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.4k
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
イベント駆動で成長して委員会
happymana
1
320
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
Better Code Design in PHP
afilina
PRO
0
120
subpath importsで始めるモック生活
10tera
0
300
Featured
See All Featured
RailsConf 2023
tenderlove
29
900
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
For a Future-Friendly Web
brad_frost
175
9.4k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Practical Orchestrator
shlominoach
186
10k
Automating Front-end Workflow
addyosmani
1366
200k
What's new in Ruby 2.0
geeforr
343
31k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Docker and Python
trallard
40
3.1k
Transcript
4XJGU,PUMJOѪձ 7PM !(.0ϖύϘ
4XJGUͱ,PUMJO
4XJGUͱ,PUMJO
+BWBͱ0CKFDUJWF$ ͷΛ͠·͢
ͳΜͰࠓ͞Β+BWB0CK$
ͳΜͰࠓ͞Β+BWB0CK$ w ࠓͷ࣌ΞϓϦ4XJGU,PUMJOͰॻ͘ͷ͕ͨΓલ w ࠓͲ͖+BWB0CK$ͳΜͯ৮ΒΜΖ
Ռͨͯ͠ຊʹͦ͏ͩΖ͏͔ʁ
Ռͨͯ͠ຊʹͦ͏ͩΖ͏͔ʁ w 044ϥΠϒϥϦϦϦʔε͞Εͨ࣌ϥΠϒϥϦͷಛ ੑ্+BWB0CK$Ͱॻ͔Ε͍ͯΔͷ·ͩ·ͩଟ͍ w ࣮Λ֬ೝͨ͠Γ13Λग़ͨ͠Γ͢ΔͳΒͬͺΓͦͷล ͷࣝඞཁ
ͱ͍͏͜ͱͰ
ҙ֎ͱҾ͔͔ͬΔʂʁ ݴޠ༷ΫΠζ +BWB0CKFDUJWF$ฤ
w 5BLVIJSP.VUBBLB໊Նر ,* w 4& 8FC J04 "OESPJE ৽ਓݚमߨࢣFUD
J04 डୗ։ൃ J04 ࣗࣾ։ൃ ࠓίί w 5XJUUFS 2JJUB@LJ (JU)VC,* w 4XJGUѪձࢀՃप ͏ΜΧϨʔ ͓લ୭Α
#VJME$POpHTXJGU ελʔ͍ͩ͘͞
ݴޠ༷ΫΠζ w +BWB w 0CKFDUJWF$
+BWBฤ
ୈ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } }
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
ղઆ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } } 6OSFBDIBCMFDPEF
ୈ
ୈΛ౿·͑ͯ public class Sample { public static void main(String... args)
{ while (false) { System.out.println("hoge"); } } }
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ do { System.out.println("hoge"); } while (false); } }
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ do { System.out.println("hoge"); } while (false); } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
࣍ͷίʔυͷಈ͖Ͳ͏ͳΔʁ public class Sample { public static void main(String... args)
{ do { System.out.println("hoge"); } while (false); } } lIPHFz͕ճ͚ͩग़ྗ͞ΕΔ Կى͖ͳ͍ ίϯύΠϧΤϥʔ ࣮ߦ࣌Τϥʔ
public class Sample { public static void main(String... args) {
do { System.out.println("hoge"); } while (false); } } ղઆ EPXIJMFࣄޙධՁ ճॲཧͨ͠ޙʹ݅ࣜΛఆ
ղઆ ॲཧ ݅ XIJMF ॲཧ ݅ EPXIJMF
0CKFDUJWF$ฤ
ୈ
Կ͕ग़ྗ͞ΕΔʁ
Կ͕ग़ྗ͞ΕΔʁ if (@0) { NSLog(@"true"); } else { NSLog(@"false"); }
Կ͕ग़ྗ͞ΕΔʁ if (@0) { NSLog(@"true"); } else { NSLog(@"false"); }
USVF GBMTF
Կ͕ग़ྗ͞ΕΔʁ if (@0) { NSLog(@"true"); } else { NSLog(@"false"); }
USVF GBMTF
ղઆ w @0</4/VNCFSOVNCFS8JUI*OU>ͷ4ZOUBY4VHBS w /4/VNCFSΦϒδΣΫτ w ΦϒδΣΫτͱͯ͠ଘࡏ͢ΔͨΊɺ USVFͱͯ͠ఆ͞ΕΔ w @NOಉ༷
ୈ
Կ͕ग़ྗ͞ΕΔʁ
Կ͕ग़ྗ͞ΕΔʁ [ "hoge", "fuga", null, "foo", "bar" ] TBNQMFKTPO NSArray
*array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
Կ͕ग़ྗ͞ΕΔʁ USVF GBMTF [ "hoge", "fuga", null, "foo", "bar" ]
TBNQMFKTPO NSArray *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
Կ͕ग़ྗ͞ΕΔʁ USVF GBMTF [ "hoge", "fuga", null, "foo", "bar" ]
TBNQMFKTPO NSArray *array = ... // JSONΛಡΈࠐΉॲཧ if (array[2]) { NSLog(@"true"); } else { NSLog(@"false"); }
ղઆ w /4"SSBZͷίϨΫγϣϯʹOJMΛೖΕΔ͜ͱ͕Ͱ͖ͳ ͍ w େମखஈͱͯ͠/4/VMMͱ͍͏ΫϥεΛ͏ w ͜ͷ࣌BSSBZ<>͔ΒऔΓग़͞ΕΔͷ</4/VMMOVMM>ͱ͍͏ γϯάϧτϯΦϒδΣΫτ w
ΦϒδΣΫτͳͷͰUSVFͱͯ͠ఆ͞ΕΔ
/4/VMMͱOJM NSLog(@"%@", nil); // -> (null) NSLog(@"%@", [NSNull null]); //
-> <null> ྻʹฆΕ͍ͯΔOVMMΑ͘ݟམͱ͕ͪ͠
͜ΜͳΜͬͯͯԿʹͳΔʁ
͜ΜͳΜͬͯͯԿʹͳΔʁ w +BWB w 0$+1 0SBDMFೝఆࢿ֨ Ͱ͜͏͍͏͕ग़͞ΕΔ w ࣮Ͱ͏ҙຯ໓ଟʹແ͍͕ɺ ϨΨγʔͳγεςϜͰۃكʹฆΕࠐΜͰΔ
w ϦʔμϒϧίʔυͬͯͬͯΔʁ
͜ΜͳΜͬͯͯԿʹͳΔʁ w 0CK$ w ҙ֎ͱݟམͱ͕ͪ͠ w ͜ͷखͷޡղ͔ΒੜͣΔόά͕࣮ࡍʹ͋ͬͨ w 4XJGUͷϦϓϨʔεͰఆͱҧ͏ಈ͖Λ͢Δͱ͔ w
ಛʹྻʹฆΕࠐΉOVMM͋Δ͋Δ
͜ΜͳΜͬͯͯԿʹͳΔʁ w ͍ͭͰʹ w ৽ਓݚमͰυϠΕΔ
·ͱΊ w ϨΨγʔݴޠͷཧղϦϓϨʔεͷڧ͍ຯํ w ࢥΘ͵όάΛੜ·ͳ͍ͨΊʹݴޠ༷ͷཧղେ w ࣮ͰΘͳ͍͔ࣝͩΒͬͯܰࢹ͠ͳ͍Α͏ʹ
ྑ͍͓Λʂ✋