How do I get better at programming?

I often get asked by students especially new ones, “How do I get better at programming?”. Usually I get some sort of eye roll when I tell them my answer. In fact my answer has changed over the last several years. I remember asking one of my professors the exact same question in college and getting my current answer back.  When I first started teaching and working in the industry and someone asked me, I would say something like; “Read a lot and learn as much as you can.”. Looking back I see now the error of my advice. Now when I get asked that question, my typical answer is “Practice”.

I have a couple videos I like to use on the first day of class. The first video talks about the theory from the book Outliers: The Story of Success that it takes 10,000 hours to become an expert. The author of the video goes on the show how it really only takes 20 hours to learn a new skill. The plan he lays out is great and can work for anyone, but the major hurdle is practice. This theory and system will not make you an expert in anything, but will get you started on the right track. This plan isn’t going to let you loose 100 pounds in a month and you are not going to be an expert in anything in 20 hours, but it will get you started on the adventure of learning.

Looking at a lot of self help books and reading lists for being successful and they all say the same thing. They all have the same underlying message. Do a little at a time and you will get there. You want to be rich? Start investing now. You want to be successful?  It’s funny when I went back to college to get my degree, the first day of classes I remember thinking “this is going to be a long 4 years.”. I remember sitting in a philosophy class that first semester and thinking about the journey I had set out on. I compared it with a car trip my wife and I were going to take on a weekend. The trip it self was going to take us about 4 hours of driving time. I remember thinking it would be great if I could just save the time and tele-port myself to the destination. We all know that didn’t happen. I decided to enjoy the ride and the time I would be spending with my wife. But the reality of it was I had to go through the car ride to get to the destination. I  had to make the journey. I had to put in the time to get the desired outcome.

A similar thought went through my mind when my first child was born. I, like many new parents, was scared. How am I going to make it through all this? Or how are we going to afford this child? My mother gave me the best advice which was simply to take things one day at a time. What do I have to accomplish today?

Ok, back to the question at hand. How do I get better at programming? The common theme I hope I am driving home is, practice. Take things one step at a time and enjoy the journey. If you don’t like learning then be honest with yourself and say maybe being a programmer isn’t for me. It is ok to make that choice, but you have to make it otherwise you are just wasting your time. No one has become an expert without practice. I feel this is the advantage children have over adults when learning. Children have the time to put into learning. They are not bogged down by mortgage payments or car loans or going to work for 8 hours a day to pay for said things. They can put the time in quickly to learn something new, because all they have is time.

Why are successful people successful? They have taken the time to practice their craft and improve on every little thing. They have started with the 20 hours and tested the waters, then if they liked the results they put in more time. They don’t waste time doing things that will not get them to the goal they want achieve. They practice more and more and put in the time each day.

As a programmer I see listings all the time for senior developers or senior engineers. What is a senior developer? Well in most cases they specify a degree of some sort and a minimum 5 years of experience. Well doing a little math. (I know just when you thought you were done with it.) 40 hours per week for 5 years equals 10,000 hours. Coincidence? I don’t think so. The senior developer with 5 years experience is considered the expert in the field. So how do I get better at programming?

Again my one word: Practice. You have to put in the time to be good at anything. The more dedicated practice you put in, the better you will be. (I deliberately said “dedicated”.) Dedicated and focused practice is key. I was asked by a student, “Why am I not getting hired? I have all the degrees and knowledge.” I responded with something along the lines of, “What have you done with the degree and knowledge?” The student didn’t like this very much, because the truth was that they had felt that they had put in all the time required to get the job. The harsh truth is, for every job you apply for there are 5 to 10 others that are applying for that same position. What makes you better than the others? What makes you stand out? What have you done with your knowledge? I have landed more jobs by showing the interviewer what I have accomplished on the side, not what I have done for a company.

programming_languagesBy using dedicated practice you are looking for ways to get better at your craft. You are deliberately putting in the time to get better and figure things out. You are not just going through the motions to put in the time. You also need to focus on your practice. Find the areas you can improve on and focus directly on those areas. This maybe understanding a language better or gaining knowledge about a new technology you would like to learn or use on a project.

So I know what you are thinking. How do I practice? My answer is going to be two fold. One, if this is new technology that you want to learn seek out tutorials or books on the subject and work through the example projects in the subject matter. If is just something you would like to get better at, find a project that could use refactoring or maybe you have that side project you have always wanted to start. Working on side projects is a great way to build knowledge, practice your skills and maybe gain something you can show off to potential employers. The second half is to identify areas you feel you need practice. We all have areas that could be improved upon and identifying these subjects helps show us what to practice on. Maybe you just don’t understand that piece of code you took from the internet. Or a colleague showed you something that you thought you understood, but they showed you something different and unexpected.

A good way to figure out your short comings is to teach others. I found this out when I started teaching. I now had to explain these concepts and ideas to others which meant I needed to understand them myself. Teaching others to program is a great way to give back and stretch your knowledge and understanding. After listening to an older podcast from Scott Hanselman I found that in teaching others I have learned more about programming and my understanding has increased on various topics. I can then go back and apply what I have learned and cement that learning even more. Nothing forces you to understand a concept better than needing to explain it to someone else. You have to make sure you understand it, then translate that into something you can explain to someone else. Explain Like I am 5, is a complete subreddit that is dedicated to teaching others in terms anyone can understand.

So to wrap this all up in a nice little bow. How do I get better at programming? Practice. One simple word that will make all the difference in your career and life. Practice your knowledge, learn more, teach others and get better programming.