Over the past few months, I've been learning to write iOS apps in Objective-C, and finally I'm starting to get my thoughts in order. It was much harder than I imagined and took far too long.
I often ran into difficulties and felt frustrated, and fixing bugs took far more time than actually writing code. But there's an amazing feeling that comes from playing with an app on my phone that I built from scratch.
I learned a lot this way, not just about developing iOS apps, but about programming in general. I also ran into some problems that I might have avoided if I had learned Objective-C differently.
Looking back, if I were to learn programming today, I would do some things differently.

Find a Programming Partner
I've also found a learning method that works: having a real, living person to talk to.
My co-founder Josh, who mainly does Python development, actually learned Objective-C alongside me and answered a lot of my questions about programming theory ("How do I get an if statement to work again?"), and helped me debug when I was really stuck.
Having an extremely patient programming partner who could explain basic programming principles was a huge help. Josh often helped me think through most of the logic for solving a problem before I worked out the specific details in Objective-C.
Make Good Use of Resources
If you're not lucky enough to have a patient programmer nearby to answer questions, there are other places where you can get help from real people:
For questions about specific syntax or implementation, Stack Overflow is one of the sites I've been visiting most lately. I haven't asked questions there myself (I've been cautious about asking, even though the community is quite friendly to beginners), because I rarely need to — by browsing the answers to other people's questions, most of my problems get solved.
Treehouse teaches programming through video lessons and also has a community forum where you can discuss difficult bugs or specific exercises you encounter while taking the courses.
When you need help, askadev lets you connect with experienced developers. I haven't tried this service yet, so I don't know how useful it is or whether it covers every programming language, but it's free, so you might as well give it a try next time you need help.
If you want to pay experienced developers for help, Codementor matches you with people who are familiar with the language you're learning. They cover Android, iOS, HTML, CSS, PHP, Python, and many other technologies.
Rubber Duck Problem Solving
If you haven't seen it before, the "Rubber Duck Problem Solving" blog post is very useful. The idea is: explain your problem out loud to a rubber duck or another inanimate object, like a toaster. The process of talking through the problem aloud often helps you realize the answer yourself (or at least figure out where things went wrong). I've found that talking about my code out loud is an incredibly good habit, and I try to do it every time before I ask someone for help.
Learn the Standards
The thing that affected me most during my time learning to program was misunderstanding and being unfamiliar with the technology I was using. For example, working with APIs meant I needed to understand how APIs work, how to use POST and GET requests, how to parse JSON data, and even that I needed to handle receiving JSON data.
Learning Objective-C isn't everything you need to know to develop iOS apps — at least, not the kind I wanted to develop. I made the mistake of thinking that simply knowing Objective-C would be enough. Even worse, I often ran into trouble because the people answering questions on Stack Overflow, online tutorials, and book chapters all explained how to develop in Objective-C while completely skipping the web-based principles I needed to know, assuming I already knew them.
If I were starting over today, I would first build up my knowledge of HTML and CSS. When I started running into new technologies I didn't know much about, I would get a general understanding of them before trying to implement them in Objective-C.
You Can Start with Any Language
If you're really not sure where to start, or what you want to develop, don't let that stop you. Even though I spent time learning Ruby and Python without completing any projects with them, I don't consider that time wasted.
A common starting point for beginners is learning HTML and CSS to develop websites. They are actually markup languages, so if you want to develop mobile or web apps, learning HTML and CSS might seem like a waste of time. But in this case, you'll gain knowledge and experience that will help you as you continue learning programming languages.
If you're eager to start learning programming but don't know where to begin, just pick a book, tutorial, or online course — whatever you like — and work through it! Once you have a better understanding of what you want to build, you can always choose to learn a different language.
Find a Project You Truly Care About
For me, the biggest learning curve was probably finding the motivation to keep learning to code. I tried many times in the past: learning HTML and CSS as a kid, learning the basics of Ruby a few years later, and learning Python more recently.
I decided to learn Objective-C not because I liked it more than Ruby or Python, and not because I knew people who were learning Objective-C, but simply because I had a list of iOS app ideas I wanted to complete — I really wanted to build them.
My motivation to learn Objective-C was stronger than with any other language I had learned before, because I had personal projects I wanted to develop motivating me.
Most importantly, as the difficulty increased and I felt frustrated and ran into problems, I didn't give up — because I was developing a project I truly cared about. Every time I managed to implement some new feature and it worked well, the payoff was even better because it was part of a project I was passionate about.
If you're considering learning programming and you have no constraints on language or platform choice, I strongly suggest choosing a project you're truly passionate about, and that will lay the foundation for choosing the language the project requires.
Everyone learns differently, so you may have a different experience than I did, but if you're just starting out or considering learning to program, I hope my experiences and mistakes can help you learn faster.
- Note: The little yellow duck debugging method, also known as rubber duck debugging or yellow duck de-bugging (Rubber Duck Debugging), is one of the code debugging methods used in software engineering. It means patiently explaining the purpose of each line of code to a little yellow duck during debugging, error correction, or testing of a program, in order to spark inspiration.
Article source:www.labazhou.net
Original English text:What I would do differently if I was learning to code today