default author profile
Alys Brooks

5 Best Ways to Learn to Code

Regardless of which computer programming language you choose, you’ll need resources to actually learn to code.

As you evaluate your options, remember that, like learning a musical instrument, actual practice is key when you’re learning to code. While you can learn the principles, terminology, caveats, tricks, and pitfalls from listening or reading, to actually improve your ability to write code…you have to write that code.

Of course, circumstances and learning styles are different, so you might need a bit of trial and error while you figure out your best approach to learning coding basics. However, even if this is your first programming language, you’ve learned something before - use that experience to get started.

1. Online Programming Courses

Online courses might have the most hype regarding all the options, and there are a ton. Their major advantage is allowing you some flexibility while still providing structure in terms of an outline, and often regular deadlines. They also tend to be cheaper than in-person classes. Still, they can be more expensive than books or tutorials.

Some of these, like MIT’s introductory computer science course, are free. Others, like those on Udemy, Codecademy, and Skillshare either have an upfront cost or a subscription. This route is cheaper than courses at a university or community college. When looking for the best option for you, try watching an example course or two to see if you find the course’s approach clear and engaging before diving in.

A growing category of online courses is coding bootcamps. Bootcamps are similar to other courses, but tend to be more intensive, and oriented specifically toward getting a coding job (often a job in data science). If you have the time to devote to a bootcamp and it’s centered around your goals, go ahead. Because these kinds of online coding courses are relatively new, there are fewer established schools and companies, so be sure to research a bootcamp carefully before paying tuition.

2. In-Person Programming Courses

In-person classes are a natural choice if you currently attend a high school or university with computer science or programming courses.

It’s important to understand the difference between computer science and programming. Computer science is the theory behind programming and computing in general, while programming is the actual practice of writing programs. Sometimes you’ll also see references to software engineering, which has a similar practical emphasis as programming, but a greater focus on the skills needed to create reliable software, often at a large scale. The line tends to be a bit blurry, so do your research.

The advantage of in-person programming courses is that they’re highly structured and make it easy to find both an expert (the instructor) and peers (your classmates). The downside is that they tend to be expensive, require enrollment, and are less flexible than other options.

In-person courses are perhaps some of the easiest to find, but you may be limited to nearby colleges and universities. Sometimes instructors have lessons online that you can watch to get a sense of their teaching style. If those are not available, ask around to see what other students have thought of the course.

3. Programming Books

Books have fallen out of favor somewhat, but they can still be a good choice if you like learning from a text. They’re nice if you have a small monitor, as you can have the book you’re working from open next to your computer rather than taking up space on your screen. Because publishers serve as sort of a gatekeeper, authors of technical books tend to be both knowledgeable and clear writers. The most obvious downside is that if you want to use any of the sample code in the book, you often have to type it in yourself. Books about coding cannot be updated efficiently once they’re published, and take longer to update than other kinds of materials, so there’s a definite risk that your book will be out of date.

Despite the fact that you’re learning from a book, don’t make the mistake of sitting down in an armchair and never writing any actual code!

Reputable publishers like O’Reilly and No Starch Press have good options for a wide variety of languages. And of course, you can find other good options by reading reviews on online bookstores. Usually, Amazon allows you to read an initial chapter or section so you can get a feel for the book. Many publishers also have a table of contents on their web page for their books.

Finally, a lot of technical books address their intended audience - whether the book teaches coding for beginners or a more intermediate audience - in the introduction, so don’t skip over it. Introductions in coding textbooks are key because sometimes the cover and title don’t do a good job of clarifying whether it’s meant for people new to programming, or just people new to a specific language.

4. Blog Posts and Coding Tutorials

The difference between online resources like blogs and coding tutorials and textbooks is a little gray, as some textbooks are available on, or even as, web pages. Textbooks available online are some of the best resources for new coders: they’re as complete as books and they’re available online.

The primary advantages of coding tutorials and blog posts are that they are free and some of the first to be updated when a language or method change. Often, they’re written by the creators of a programming language, and thus their authors understand the language at a very deep level.

The downside is that the creators of coding languages tend to have much more technical expertise than teaching or writing experience, so blog posts are not always easy to follow. Sometimes they’re also incomplete, either because the author abandoned the project part of the way through, or they decided to only cover the basics.

As with textbooks, be sure to actually work through the coding examples, assignments, and programming exercises on your computer.

Where to find coding exercises

Most programming languages have tutorials on their “official” websites. For example, if you’re learning Java, you can check out the official tutorial. These tutorials are usually good for new programmers, but non-official tutorials tend to vary in quality. Since they’re free, you can jump right in and see how you like them. You might also want to read comments underneath a tutorial. It should go without saying that online comments are very hit-or-miss, but they can often point out details the author missed, things that have changed since the author wrote the tutorial, and sometimes can provide useful shortcuts or pro advice.

5. Coding Tutors

While tutors often come in after you’ve started learning coding and have run into problems, you can also bring them in at the beginning. Many tutors are available to teach lessons, go through concepts, or recommend resources.

The advantages of tutors are that they are able to answer your specific questions, tailor their approach to your learning style, go over your specific weak points, and help you with the exact bugs you’re seeing. They also tend to have a good mix of teaching experience and technical expertise. Often the cost is worth it to clear up a misunderstanding that would otherwise waste hours of your time or cause you to lose points on an exam.

You can, of course, find tutors at Wyzant: Python tutors, Java tutors, and all-around coding tutors. Wyzant allows you to look for both in-person and online tutors and find a tutor with real-world experience and a price you can afford. If you find a promising tutor, ask if they will give you a short lesson for free, so you can get a sense of their style before committing.

Bonus: Coding Challenges

Coding challenges give you a problem or series of problems to solve with code and are often agnostic to what language you use. Some are geared more toward practical problems, others toward theoretical problems in math or computer science.

Coding challenges are a great way to put the skills you learn into practice. They can also be more satisfying because you’re actually solving a problem or making a real (if simple) program. The limitation of coding challenges - and why this a “bonus” option - is that you can’t use them on their own. If you’re starting from scratch, you won’t have the knowledge to get started. As you learn concepts, programming challenges are a great way to reinforce them.

Some good sources for coding challenges include Daily Programmer or Advent of Code. If you like more mathematically focused ones, try Project Euler. If you’re building up your Machine Learning chops, try Kaggle. Like blog posts and tutorials, these tend to be free, so the best approach to seeing if they work for you is to try some.

Some final advice

Keep in mind that these options are not mutually exclusive - you can take a course at your university and then use online videos when you get stuck on, say, objects and classes. Or you can pick up Python for Data Analysis, reach out to a Python tutor if you get stuck, or start with reading The Basics of Learning Python. Or you can start with your high school’s AP course and finish up with Java Review for the AP CS A Exam.

Although the variety of options can be overwhelming, it does mean there’s a lot of ways to learn to code. Don’t be afraid to give up on a book or course that isn’t a good fit. Programming requires a whole new way of thinking. Don’t be discouraged if the first resource you find isn’t a fit for your learning style or goals.