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
イベント駆動で成長して委員会
happymana
1
320
Outline View in SwiftUI
1024jp
1
330
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Ethereum_.pdf
nekomatu
0
460
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
flutterkaigi_2024.pdf
kyoheig3
0
140
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Featured
See All Featured
Fireside Chat
paigeccino
34
3k
Code Reviewing Like a Champion
maltzj
520
39k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Unsuck your backbone
ammeep
668
57k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
A better future with KSS
kneath
238
17k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Adopting Sorbet at Scale
ufuk
73
9.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.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 ࣮ͰΘͳ͍͔ࣝͩΒͬͯܰࢹ͠ͳ͍Α͏ʹ
ྑ͍͓Λʂ✋