Background Image

What is the best way to practice coding?

You've found a great course, tutorial, or book that will teach you to code. The resource speaks to you, it makes perfect sense, and you're learning a ton. You've successfully begun your journey in learning to code. Good for you!

The next step, naturally, is to practice what you've learned. If it's not obvious, practice is crucial to the learning process. This holds true for every subject, and it's certainly true for coding. Imagine trying to learn the violin solely by watching someone play it, without you ever touching the violin yourself. The same applies with coding: You can understand the concepts clearly, but never become proficient in it without putting in a ton of practice.

But how do you practice? Or better put: What is the best way to practice coding?

Different people operate differently, so there many not be one best way for everybody. However, I'd like to present a specific, effective approach that you may not have previously considered.

Best-selling author and blogger James Clear writes extensively on a type of practice called "deliberate practice." I highly recommend reading his blog posts on this topic. Two good articles to start with are here and here.

Clear writes that "deliberate practice refers to a special type of practice that is purposeful and systematic. While regular practice might include mindless repetitions, deliberate practice requires focused attention and is conducted with the specific goal of improving performance."

Deliberate practice consists of the following components:

  1. Show up to do your reps.
  2. Break the overall process down into parts
  3. Measure yourself
  4. Test new strategies for each section
  5. Integrate your learning into the overall process.

Let's explain what these steps mean, and specifically in the realm of practicing coding. By the way, these strategies aren't just for coding newbies. They can be used by experienced software engineers as well to help them level up in their skills.

1. Show up to do your reps

Carve out time every day to practice coding. As much as possible, try to never miss a single day - keep the streak going! It's better to practice for a shorter time each day than to practice for a longer stretch once a week. I recommend building practice time into your daily schedule rather than trying to find time each day to squeeze it in.

2. Break the overall process down into parts

Most aspects of coding consist of several different parts. Building a web app, for example, can consist of back-end programming and front-end programming. Back-end programming, in turn, can be broken down into using a server-side language, a server-side framework, and database design. Front-end programming can be broken down into using HTML, CSS, JavaScript, and a front-end framework. And then there's the use of developer tools, such as the terminal, a text editor, and version control.

Dedicate each practice session to one of these smaller components if possible, as this will allow you to hone each specific skill. Otherwise, you might end up grappling with all the moving parts at once and never become truly proficient at each of the sub-skills. You may be able to create web app after web app, but the quality of your web app may not increase over time, as you're not really getting better at any one skill. (Integrating the moving parts together is itself a skill that you do gain, but it's only one of the many skills involved.) On the other hand, if you can level up each sub-skill, the web apps you build afterwards using these honed sub-skills will be markedly better.

3. Measure yourself

While quality, in general, is difficult to measure, there are ways you can measure your skill level in coding from a quantitative perspective. One example is measuring the time it takes you to accomplish a task. For example, it may take you 20 minutes to solve a basic algorithm in JavaScript. You can continue to practice basic JavaScript algorithms and see if you can gain more fluency to the point of where it may take you less time. Generally speaking, the more fluent one is in a coding task, the less time it would take to accomplish that task.

Another factor is the number of error messages you encountered during your task. If while solving a JavaScript algorithm, you end up receiving 5 error messages before getting it right, you can continue to practice and see if you can solve similar algorithms while getting fewer error messages. There's nothing wrong with getting error messages, of course, but by getting fewer error messages is generally a sign of increased fluency of your skill.

4. Test new strategies for each section

A major aspect of deliberate practice is that you don't just mindlessly practice a given skill. Instead, you take note of your weaknesses and test new approaches that may possibly help you get better. Continuing with our JavaScript algorithm analogy, you can test different approaches to see if they help you solve problems more quickly or with fewer error messages. For example, what happens when you consistently use "while loops" instead of "for..in loops"? Does that help you crack the code more quickly? Or does drawing out visuals on a piece of paper before typing your first character help you solve the problems more efficiently? Does writing psuedocode help? Different approaches work for different people - but you can discover what approaches work for you.

5. Integrate your learning into the overall process

As you hone each sub-skill, go back and create a new web app again. Hopefully, your increased skill in - say, JavaScript - will help you write that web app more easily, more efficiently, or with more confidence.

Conclusion

The key of deliberate practice is to not mindlessly practice and hope that you get better. Instead, you can specifically test your level of proficiency now, and deliberately try new approaches and see concrete, measurable improvement.

Get Expert Advice

The Actualize Blog is where you can get expert advice and insights for learning to code from our CEO, Jay Wengrow. Subscribe to the Actualize Blog and get notified each time we publish a new article.

*We won't share your email with third parties.