So, about a month ago I was working on a task that took me way longer than I would have liked. As time passed, and the task remained unsolved, the more I felt like I was failing on the road to completion. I should state that I don't necessarily see failing as a negative thing, failing to me can be an opportunity to learn from mistakes, so this blog post is about what I learned while stumbling towards a solution.
Ask questions: It’s always good to ask questions, but the right questions. Dig a little deeper before asking surface level questions. Before asking for help, you should already know the answer to these questions: What is it the you’re currently working on (this is an obvious one)? What solutions have you tried so far? What is the result that you’re trying to get? What result are you currently getting?
Broaden your scope: sometimes you can get so laser focused on a few lines of code that are in your immediate line of focus, maybe because you’re sure that the solution is right there in front of you. Well, sometimes it’s not and you need to broaden your scope and locate the actual problem - which leads me to...
Examine and break down your error/ Debug, debug, debug: XCode has blessed us when it comes to debugging. Breakpoints, view hierarchy and step controls that allow you to step through your code. Use them!
Read the documentation: and I mean really read it! I’m the queen of skimming. Sometimes that works and you can garner enough information, sometimes it doesn’t and you have to read Apple’s documentation from top to bottom to connect the dots.
One more thing I’d like to mention that may help someone avoid being stuck on a problem for too long… plot out your course of action beforehand. I have a tendency to receive a task and dive head first into it. Which is sort of like heading to a new destination for the first time, hopping in the car to said destination, with no sense of direction when GPS is readily available. Overall, I learned quite a bit through “failing” and I’m still trying to remember to take my own advice.