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
280
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
26
The history of entry-point in iOS app Development
417_72ki
0
370
R.swift to Asset Symbols
417_72ki
0
260
Refactor with using `available` and `deprecated`
417_72ki
3
610
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
400
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
900
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.5k
Mockable UserDefaults with Duck typing
417_72ki
0
860
Other Decks in Programming
See All in Programming
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
290
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
たのしいparse.y
ydah
3
120
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
470
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
Beyond ORM
77web
5
670
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Featured
See All Featured
It's Worth the Effort
3n
183
28k
Raft: Consensus for Rubyists
vanstee
137
6.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Statistics for Hackers
jakevdp
796
220k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The Cult of Friendly URLs
andyhume
78
6.1k
Embracing the Ebb and Flow
colly
84
4.5k
Building Your Own Lightsaber
phodgson
103
6.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
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 ࣮ͰΘͳ͍͔ࣝͩΒͬͯܰࢹ͠ͳ͍Α͏ʹ
ྑ͍͓Λʂ✋