13 Min.

Optionals Are Evil..‪?‬ Inside iOS Dev

    • Technologie

When and where should optionals be used? What are the advantages and disadvantages of optionals? Before Swift, iOS developers wrote their apps using Objective-C. In Objective-C, programmers could send messages to nil without the program crashing and in some cases was considered a feature. However, sometimes objects were unexpectedly nil and the program would incorrectly execute. Today, Swift uses optionals to more explicitly handle the case when an object is nil.

When and where should optionals be used? What are the advantages and disadvantages of optionals? Before Swift, iOS developers wrote their apps using Objective-C. In Objective-C, programmers could send messages to nil without the program crashing and in some cases was considered a feature. However, sometimes objects were unexpectedly nil and the program would incorrectly execute. Today, Swift uses optionals to more explicitly handle the case when an object is nil.

13 Min.

Top‑Podcasts in Technologie

Acquired
Ben Gilbert and David Rosenthal
Bits und so
Undsoversum GmbH
Apfelfunk
Malte Kirchner & Jean-Claude Frick
Flugforensik - Abstürze und ihre Geschichte
Flugforensik
Lex Fridman Podcast
Lex Fridman
c’t uplink - der IT-Podcast aus Nerdistan
c’t Magazin