Become a Great Programmer Through Deliberate Practice

Become a Great Programmer Through Deliberate Practice:

Just writing code is not enough


By now, most of you have heard of the 10,000 hour rule. To become an expert at something, anything, it takes 10,000 hours of work or practice. This rule was popularized by Malcolm Gladwell in his book Outliers. However, it’s not just any sort of practice that will make you an expert at something – it’s 10,000 hours of deliberate practice, that is, practice that is not just mindlessly doing the same thing over and over again, but conscientiously practicing harder and harder tasks that extend your ability. In this article, I’m going to introduce you to deliberate practice and how you can apply it to learning computer programming. In future articles, I’ll dive more specifically into ways of using deliberate practice to improve your knowledge and skills in any computer programming language you choose to work in.

How is Deliberate Practice Different Than Just Plain Practice?

Everyone knows what it means to practice something. You want to improve a skill so you perform the skill continually until you feel like you’ve perfected it. The problem is that most people practice by doing the same thing repeatedly. This doesn’t lead to becoming an expert in a field; it just makes you better at that task. And in many cases, especially when practice just means doing the task professionally, you will get worse at the skill over time. In the book Peak: Secrets from the New Science of Expertise, Anders Ericsson discusses how, in studies on the quality of care provided by physicians, those physicians who have been practicing for many years do worse than physicians only a few years out of medical school. Why is this? Ericsson contends that it is because, rather than practicing deliberately, physicians are mostly going through the paces when they are performing their tasks rather than working to sharpen their diagnostic skills by working on new, harder cases.

The same is true in many other skills. People who take up a sport, such as tennis, will at first practice a lot and get better at better at the different skills involved in tennis – serving, forehand strokes, and backhand strokes. Most people, though, will reach a point where their tennis game is sufficient for their needs (they can win a few matches or at least look like they know what they’re doing), but they don’t really become expert at the game. In fact, over time, their tennis playing skills will atrophy somewhat, even if they are playing tennis matches on a regular basis, especially if they are playing the same opponent or opponents of the same skill level.

Psychologists who study expertise have found this true for many different skills and professions. Practicing, or performing, in the same manner over a long period of time does not improve your skill in your chosen field, in fact, your skill level will drop over time unless you modify how you practice and adopt the mindset of deliberate practice.

Deliberate Practice Defined

There are several characteristics that distinguish deliberate practice from regular practice. These are discussed in detail in Ericsson’s book and I will just outline them here:

  • Deliberate practice requires an effort that is outside your current comfort zone.
  • There needs to be a well-defined goal, such as improving a skill leading toward a specific event or performance.
  • Deliberate practice requires extreme focus and should follow a plan designed, at first by a teacher or mentor, and later by the practitioner on his or her own.
  • Deliberate practice requires that the practitioner receive feedback. This feedback should first come from a coach or mentor, but later practitioners must learn how to provide their own feedback.
  • Deliberate practice requires the use of effective mental representations of the skill involved.
  • Deliberate practice will always work to build on an existing skill and improve the skill incrementally. Doing this over and over will lead to expert performance.

Great Programming Through Deliberate Practice

So how can you use these principles of deliberate practice to become a great programmer? Let’s look at some of the principles above to see some ways we can apply them to learning to program as experienced by someone who has perhaps already taken one course in programming, say in JavaScript.

Deliberate practice requires effort outside your current comfort zone.

Let’s say you are learning about loops and arrays. You’ve already written several programs that display the elements of the array or sum the elements of a numeric array. You need more challenging problems. One place to look is codingbat.com and the AP-1 section. Here you will find several problems that are more challenging than you will find in most introductory textbooks. The problem solutions are in Java or Python but the problems are suitable for any programming language. They provide sample inputs and outputs (feedback) so you can know if your program is working or not. There are also many excellent books that present programming problems for you to work. Caution: selfish promotion ahead. I have several of these books in the works, which I’m calling my Worked Problems series. See my website thelearningprogrammer.com for more information.

Deliberate practice has a well-defined goal.

If you are currently a student enrolled in a course, this one is easy. The specific event or performance you are working toward will probably be either a test or a project. If you are a self-taught learner, this one is a bit harder. One of the things I do with my students is ask them to re-write some of the library functions in the programming language they are learning. These functions usually require knowledge of more than one programming construct so you are getting great practice in several areas in one program.

Deliberate practice requires extreme focus and should follow a plan designed, at first by a teacher or mentor, and later by the practitioner on his or her own.

Again, for a student enrolled in a course, the instructor will have a plan laid out for you that usually involves working with a textbook and the exercises in the textbook and/or exercises and tests the instructor creates. If you are studying on your own, you can follow a book on the language you are learning. If you don’t want to purchase a book, there are many free computer programming textbooks online you can download, as well as tutorial sites such as tutorialspoint.com and w3schools.com you can use as a guide into the language. A problem with books and textbooks is that many of the non-textbook books published don’t have exercises for you to work, and the textbooks that do come with exercises often don’t provide solutions to the exercises. Again, I’ll refer you to my website for a series of books that provide both problems for you to work and solutions you can use as feedback.

Deliberate practice requires feedback, first from coaches than from yourself.

Students in a high school or college course will get feedback from their instructor, though sometimes the feedback takes time to get back to them as programming instructors are usually very busy and are often teaching many students. Other sources for feedback include experienced programmers you know and problem sets that include solutions to the problems. One advantage of learning programming by implementing library functions is that you can use the built-in functions output as feedback for your learning. If your program has the same output as the built-in function, you at least know your program is working in that respect. My Worked Problems series is being written with providing feedback through worked computer program examples in mind for the self-taught programmer.

Deliberate practice requires the use of effective mental representations of the skill.

The least concrete of all the deliberate practice principles is the concept of mental representations. One of the definitions of being an expert in a field is having superior mental representations of your subject. The classic example is chess players. Master level chess players have memorized thousands of chessboards at various stages of chess games through the careful analysis of different parts of chess games played by other master chess players. They don’t develop this skill through playing more games of chess. In programming, you can study how great programmers write programs by studying open source programs and by reading books on writing good programs. Two such books are Beautiful Code, edited by Andy Oram and Gregory Wilson, and Code Reading, written by Diomidis Spinellis. Learning to program by reading great programs is not emphasized enough and every programmer should spend time reading examples of great programs, especially in areas that are outside your usual programming experience. Studying these programs will help you develop good mental representations to use in your own programming.

Always Be Learning

One of the most important skills, if not the most important skill, all budding programmers should be learning is how to learn. It’s a cliché to say that technology is constantly changing but in fact it is. Learning how to learn through deliberate practice will help you stay on top of ever-changing technology. More importantly though, becoming better at your craft of programming should be the goal of every programmer. You should be constantly trying to achieve the goal of being an expert at designing and implementing computer programs and the best way of achieving that goal is through deliberate practice.

In future articles, I’ll be elaborating on how you can become a great programmer using the concepts and strategies of deliberate practice as well as other learning and practice techniques.