How to learn coding

in #code7 years ago

How to learn coding

Introduction

If you're interested in learning to code, it's very helpful to start with the right mindset. This article by Jaren Cohen and this YouTube video by Kevin Cheers both do a great job of explaining the proper perspective you should have when starting out.

Next, you should keep in mind that there's no universally agreed way of learning to code – everybody prefers learning in a slightly different way, and you may need to do some experimenting to find an approach that works best for you. Nevertheless, the majority of people seem to learn best using the following approach, which we strongly recommend you try:

Find some small problem or project that you're interested in tackling. You could try building a tool to solve a small problem in your life, or try implementing a program you find interesting from scratch. This project will help motivate you to continue to learn to code and will give you opportunities to practice applying what you're learning.
Do some research to figure out which programming language is most appropriate for your project.
Find and follow a single, high-quality beginner-oriented resource for that language.
Supplement that resource by googling and asking questions
Eventually complete several non-trivial projects using that language.
Here are some things we recommend you avoid doing:

Don't just simply passively follow along whatever resource you're using. Do the exercises and homework assignments; practice is an absolutely essential part of learning to code.
Avoid needlessly switching back and forth between programming languages; pick one and stick with it. This is because programming is ultimately about problem solving, not about programming languages. Learning to problem-solve is challenging and is a skill you can hone only through practice. Every time you switch languages, you're losing time you could have spent practicing applying what you've learned to improve your problem-solving skills.
Don't stop learning once you've completed a tutorial. Programming is the kind of field where there's always something new to learn.
And finally, remember that learning to code can be a long and difficult process. If learning to code feels hard, don't get discouraged! That's completely normal – many people will spend years of their lives learning and practicing before they consider themselves competent enough to look for a job or contribute to a significant project. Fortunately, just getting started is not difficult at all.

Which programming language to start with?

There are two common misconceptions that cause people to ask this question. The first is that there actually is a "best" programming language for learning and the second is that the first language you learn will decide what the rest of your programming career looks like.

In reality, there is no best language to start with, and your first language has virtually no lasting effect on your eventual career. Programming languages can look very different on the surface, but the majority of the fundamental concepts will transfer from language to language. Learning a new language will also get easier over time -- it can take a beginner months before they feel comfortable with their first language; an experienced programmer can become familiar with a new language in a matter of days.

All programmers should ideally have experience in multiple types of languages. Once you are comfortable with one language, move on to another language which differs in some fundamental way. As you learn more languages, you will become more equipped to choose the right tool for the task at hand, which is a hallmark of a good programmer. Since programming concepts are what matter most, we recommended that beginners start with one of the mainstream languages from the table below. All these languages enable beginners to start writing simple applications and practice programming without having to use any of the more complex language features.

If you already have a project or goal in mind, you will learn faster if you can apply your skills to the problem you are trying to solve. The table below contains some recommended language choices for common projects:

I want to learn how to...Consider using...
...make iPhone AppsSwift
...make Android AppsJava
...build a websiteJavaScript, CSS, HTML5
...write Windows desktop applicationsC#
...make 2D/3D gamesUnity
...program Arduinos/micro-controllers/robotsC
...do scientific/mathematical computing or data analysisJulia, Python, R, or Matlab

Key to success

Make sure you can commit at least 1 hour / day to learning. Programming has a STEEP learning curve, that requires you hold a million new concepts in your head. You need to hammer away at these new concepts, and taking days off will just cause stuff to slip away from you.

Pick a discipline, not a language

Fighting over languages is the wrong approach. Instead, pick a discipline: web development, data science, systems programming, w/e. Then go learn a popular tech stack/toolset in that discipline. This will allow you to build stuff you are actually interested in, leading to more passion, and faster learning.

Pick a tech stack and stick with it

Don't get caught up in which language you should learn. Once you've picked a discipline, pick one of the popular tech stacks in that discipline. Don't fuss too much about which one to pick — it really doesn't matter, as long as it's popular enough to find jobs in, and it has good learning resources. Then stick with this tech stack for at least a year, and probably longer. Focusing on a single tech stack will allow you to grow faster as a Software Engineer, rather than just a coder, as you will gain mastery in your stack, giving you the mental space to focus on stuff like software and systems design, without getting bogged down in syntax.

The key is putting in the time

Most folks who try to learn to code fail. From what I've seen, the most common reason is not being able to make time for it. You really need to spend at least an hour a day, and more when you can. You need to be willing to spend 5 hours on Sat/Sun to have deep dive sessions. Get up early and put in an hour or two before work. Coding has a lot of new concepts and skills that you have to learn, and having to constantly relearn stuff because it drifts away due to extended breaks is going to kill motivation, and greatly slow progress.

Sort:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://www.reddit.com/r/learnprogramming/wiki/faq