Can we make Swift 6 easier?

You cannot do that without knowing anything at all about concurrency, and that’s never was the case.

You still can do that pretty easy though: you have everything isolated to main actor (with SwiftUI finally by default in Xcode 15), and then network requests aren’t isolated — and you even don’t need to care about that.

But is it changed from before-Concurrency? I’d say not a lot, and where it did, it got better. Let me explain what I mean by that.

Back with libdispatch all these bits were kinda hidden and not obvious for developers, and probably a significant part hasn’t bothered with getting into details for a pretty long time. But if you wanted to learn decently, you have to get an idea that all UI code (in some magic way tbh for a novice) should be on main thread and you are really concerned to ensure that. You don’t exactly see where it is running, but you have to operate under this assumptions. You might get off with a few basic things at first, but I still remember my first thread explosion trying to async some loading in a first month of work and that was a total chaos.

Now, with new concurrency in SwiftUI you still concerned with main thread — which is now main actor. Instead of being magical creature, it is here explicitly marking everything you touch. You get acknowledged with the state of things that crucial to understanding early on and more likely understand your code better. You still can async request in a safe way and load as much as you want without any concerns about thread explosion. So while it require a bit more mindfulness on the start, it is for better.

Also, I’d say that many has fall into illusion that writing apps for iOS is extremely easy, which is true only to some extent — you still work with a highly sophisticated system. If you a complete novice to a programming at all I’d say it is much better to start with the official book of Swift and learn how to program just using Swift, then get to iOS, because otherwise everything will be complex, no matter how simple programming language is — you can’t remove complexity from the system.

9 Likes