Abstract

Programmers are used to writing programs that are executed in a linear fashion. Because of this, programmers can write programs that are easy to read. As you write, test, and execute your program, you expect your instructions to run in the order you wrote them. If a new developer joins a software project, they can understand it by reading the source code because everything is written in a logical order. But software can grow and become more complex and require concurrency. When this happens, the program is no longer a logical set of steps that can be read from top to bottom. The moment you introduce concurrency, your software can do more, but usually at the expense of readability. The introduction of concurrency-related bugs are also very real and ver hard to debug. Traditional concurrent code requires the use of lower level tools such as semaphores and locks, and a lot of careful work from the developer. The async/await system spares developers from having to be familiar with complicated concurrency primitives that are hard to use correctly. async/await in Swift is language-level feature that allows you to write safe concurrent code that is both easy to read and write, because it abstracts a lot of the concurrency primitives for you in such a way that you will never have to think about them. This results in a system that is a joy to write, and very hard to misuse. With that said, understanding concurrency primitives can provide benefits for developers even if they never have to deal with them directly, because understanding what happens behind the scenes can become a helpful tool to see why a certain abstraction behaves the way that it does.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call