|< What are the three most common mistakes when learning Swift?||How to keep up with Swift's evolution? >|
Recorded – watch the full episode on YouTube.
When someone is learning Swift, what do you think are the most important concepts for them to focus on?
Sean Allen: Now I'm going to go a little meta on this one because you know, things like optionals, protocols, closures, all that stuff is equally important. I don't think you should learn necessarily one before the other. I'm sure there's some of them that make more sense to learn before the other, but I wouldn't worry too much about what order should I learn this stuff in?
“I talked about it earlier, having the right mindset, the right attitude of: this is going to be hard. This is going to take a while. I'm going to have to learn closures over and over and over again.”
I would worry about getting your mind right. I talked about it earlier, having the right mindset, the right attitude of: this is going to be hard. This is going to take a while. I'm going to have to learn closures over and over and over again. So having that mindset going into it with the right attitude. Because if you don't have the right attitude, you get frustrated, people quit, like that's when you don't like programming. So again, don't worry about the specific concepts you should go into. Just worry about getting your mind right. Because I think that's what separates success.
Worry about getting your mind right, because I think that's what separates successful people to complete this journey versus people that quit and don't complete it, is their attitude and their mindset.
“How many times have you said that, "This can't be me, something's got to be wrong with Xcode, this can't be me?" I've said that so many times and I'm always wrong.”
Paul Hudson: Right. Mindset is critical, as you say, because programming, when you make a mistake it's never the computer's fault or very rarely-
SwiftUI had a few bugs here and there, something that gets you in places, but it's nearly always your fault or my fault. We've typed in true rather than false, we've had it off by one error. And I saw Rob Napier tweeting about this a few months ago, saying that the first step in debugging a problem is admitting there is a problem somewhere in your code. That you've made a fundamental logic error in your code somewhere, things you thought were true or not true. And you've made a mistake from there and the bug is somewhere backwards from there.
Sean Allen: How many times have you said that, "This can't be me, something's got to be wrong with Xcode, this can't be me?" I've said that so many times and I'm always wrong.
"I do say that you have to maybe not love the grind, but at least appreciate the grind."
Paul Hudson: Well, sometimes Xcode benefits from a quick restart – it makes Core Data work better, for example, which is a shame, but they're working on that. But I think learning to say, “There was a logic error here, and I just have got to break it down to small chunks, work backwards from there to find the problem and then nail it and move on.” I mean, we all know when you finally do it, it feels great. “Yeah! I beat the computer,” or whatever it is. But that process can often be 10, 20 minutes, 30 minutes an hour, sometimes a day, or pulling code to pieces and figuring out what's going on and end up with,
print("I'm here"). It's hard.
And that's the hardest part of my job, I think it's really, really when it comes to the grind of fixing a hard bug, sticking with it, having the resilience to work through it, know it's in there somewhere, a logic errors in there somewhere, and getting it fixed at over time. It's just pure willpower.
Sean Allen: I do say that you have to maybe not love the grind, but at least appreciate the grind. If every time you hit those roadblocks or that grind, you just crumple up into a ball and frustration and hate it, then you're going to have a rough career. But if you appreciate the grind and you know what's on the other end, I think you're going to be good.
This transcript was recorded as part of Swiftly Speaking. You can watch the full original episode on YouTube, or subscribe to the audio version on Apple Podcasts.
SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!
Link copied to your pasteboard.