Preface: Swift for the Rest of Your Application
Q: Why did the human put on his boxing gloves?
A: He had to punch some cards.
Today’s applications do not run on a single platform. Rather, some parts run on resource-limited devices, and other parts run on a vast and mysterious cloud of servers. This separation has led to a schism in how we build these applications because different platforms have different requirements: the mobile portions must conserve battery power, while the server portions must handle a large number of requests simultaneously. Consequently, programmers use different languages for different parts of applications—for instance, JavaScript for the browser, and Java for the server.
However, constructing an application out of multiple languages is fraught with drawbacks: different teams in the same organization speak different languages—literally—and must master different developer ecosystems. Precious time must be spent translating concepts across language barriers and a few developers must know all of the languages in order to be effective. Test cases and data models must be replicated in different languages, introducing bugs and incurring future maintenance efforts. Because third-party libraries cannot be shared across groups, each team must learn different APIs to obtain merely the same functionality.
Swift was introduced by Apple in 2014 and replaced Objective-C as the recommended language for all new applications running on Apple devices. Later, when Swift ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access