
This post originally appeared on the Crew blog.
Iāve been learning to build iOS apps in Objective-C for the past few months and Iām finally starting to really get my head around it. Itās been a lot harder and taken a lot longer than I expected.
I often get stuck, get frustrated, and spend many more hours searching for bug fixes than actually writing code. But itās an amazing feeling to play with an app on my phone and know that I built it from scratch.
Iāve learned a lot along the wayānot just about developing iOS apps, but about programming in general, and even about my own learning process. Iāve also run into problems that I might have avoided if Iād taken a different approach to learning Objective-C.
Looking back at my experience here are some things Iād do differently if I was learning to code today.
Find a coding buddy
Iāve yet to find a method of learning that beats having a real person to talk to.
My co-founder Josh, whoās mostly a Python developer, has practically learned Objective-C alongside me thanks to fielding my many programming theory questions (āHow does an if statement work again?ā) and helping me with debugging when Iām truly stuck.
At the very least, having a patient coding buddy who can explain fundamental programming principles is a huge help. Josh will often help me think through the most logical way to approach a problem, before I work out the specifics of doing so in Objective-C.
Use every resource out there
If youāre not lucky enough to have a patient programmer around to field your questions, here are some other places to get help from real people:
Mostly useful for specific syntax or implementation questions, Stack Overflow is one of my most-visited sites these days. I havenāt asked any questions there myself yet (and Iām wary of doing so, as the community can be quite hostile to beginners) but Iāve rarely needed toāmost of my questions can be solved by browsing through answers to other peopleās questions.
Treehouse teaches programming through video courses and has built-in community forums where you can discuss bugs youāre having trouble with or specific exercises from the courses that youāre stuck on.
Askadev lets you connect to an experienced developer when you need help. I havenāt tried this service so I donāt know how useful it is or whether it covers all programming languages, but itās free so you might want to try it out next time youāre stuck.
If youāre willing to fork over some cash to get help from an experienced developer, Codementor will match you up with someone who knows the language youāre learning. They cover Android, iOS, HTML, CSS, PHP, Python, and lots more.
Rubber duck problem solving
If you havenāt read it before, this post on rubber duck problem solving is really useful. The principle is this: explain your problem, out loud, to a rubber duck or other cute inanimate object, like your toaster.
The process of talking through your problem out loud will often help you realise the answer (or at least where youāre going wrong) all by yourself. Iāve found talking through my code out loud is an incredibly useful habit and I try to do it every time I get stuck before asking someone for help.
Learn the principles
One of the main things that has held me back in my time learning to code is misunderstanding or being unfamiliar with technologies Iām working with.
For instance, working with APIs means I need to understand how APIs work, how to use POST and GET requests, and how to parse JSON data. I need to know Iām going to receive JSON data, even.
Learning Objective-C isnāt all I need to know to build an iOS appāat least, not the kind I want to build. I made the mistake of thinking Objective-C was all I needed to know.
Even worse, I often get stuck because Stack Overflow answers, online tutorials, and book chapters will explain how to do something in Objective-C, completely skipping over the necessary web-based principles I need to know, because they assume that knowledge.
If I was starting over today, I would refresh and build on my knowledge of HTML and CSS first. And when I started working with something new that I didnāt know much about, Iād learn about it in general before attempting to implement it in Objective-C.
Start with any language
If youāre really not sure where to start, or what you want to build, donāt let it hold you back. Although I spent time learning Ruby and Python, and havenāt finished any projects with either of those languages yet, I donāt feel like that time was wasted.
A common starting point for beginners is to learn to build websites with HTML and CSS. These are actually markup languages so it might seem like a waste of time to start there if you actually want to build mobile or Web apps. But even in this case, youāll gain knowledge and experience that will help you when you move on to learning a programming language.
If youāre keen to start learning to code but donāt know where to start, pick a book, tutorial, or online course that you like the look of, and go for it! You can always switch to learning a different language once you have a better idea of what you want to build.
Find a project you really care about
Probably the biggest learning curve for me has been finding the motivation to stick with my desire to learn to code. Iāve attempted it a few times in the past: learning HTML and CSS when I was a teenager, learning the basics of Ruby a couple of years ago, and learning Python more recently.
When I decided to try learning Objective-C it wasnāt because I liked the language any better than Ruby or Python, or because I knew anyone whoād already learned it, it was simply because I have a list of ideas for iOS apps I want to buildāand I really want to build them.
My motivation for learning Objective-C is higher than it was for learning any other language so far because Iām motivated by personal projects I want to make.
Most importantly, when the going gets tough and I feel frustrated and stuck, I donāt give upābecause Iām building a project I really care about. And every time I manage to implement something new and it turns out well, the pay-off is even better because itās part of my passion project.
If youāre considering learning to code and you donāt have any restrictions on which language or platform you choose, I would definitely recommend choosing a project youāre really passionate about and basing your language choice on what the project requires.
Everyone learns differently, so youāll probably have a different experience to me, but if youāre just starting out or thinking about learning to code, I hope my experiences and mistakes can help you learn even faster.
Read next: Resources to help you get started on learning Ruby
Image credit: Society of Swedish Literature in Finland
Get the TNW newsletter
Get the most important tech news in your inbox each week.