Rahul Simha
Professor of Computer Science


Department homepage

How to cope with the challenges of learning programming

Let's start by identifying the different challenges in learning how to program, many of which lead to self-defeating negative motivation.
  • Teasing out where the difficulty is. Many different issues bear down on the success of early programming. One of them, very simply, is whether you are able to perform the edit-compile-execute cycle well. This part has nothing to do with actual programming; it is more about using the features of your particular computer or the computer in the lab. It has to do with finding files quickly, being organized on your computer, and so on. But a beginning student sometimes can't tell that the frustrations are arising from something that's not properly configured. The important thing to remember is: this is usually a one-time issue that, once resolved, will never bother you until your next computer (and you get better at resolving it).
  • The current assignment. Another challenge beginning students face is that all the focus of the moment is on what's due next. This leaves behind issues that came up in earlier assignments that did not work out, and that linger to cause continual frustration.
  • Others seem to get it. This is possibly the worst of the challenges. You might see other students appearing to succeed and wonder why you aren't "getting it" and whether programming is for you. Nothing could be further from the truth. It's as if, in the first month of learning a musical instrument, you decide it's not for you. Nobody knows why skill development occurs differently in people; what we do know is that it happens in fits and starts and that some people start slower than others. There is no correlation between early success and later success.
  • Confusion. A beginning programming course can sometimes be confusing because there are so many "alien" concepts all at once. Besides the programming language, there's the difficulty of going from a word problem to a solution, there are computer issues, and a mass of information to digest.

OK, so what to do? I'm going to recommend some coping strategies:

  • Think long term. I know many outstanding CS students who "got it" (programming) in their third or fourth programming course. So many of these went on to win awards, and even better, to highly successful and remunerative careers in CS. So, hang in there, and persist. You will be glad that a lot of people worldwide chose to give up in the first course, eliminating your potential competitors in the employment pool.

  • Don't let past issues linger. If something did not work out in a previous assignment, do NOT let it go. Go back to it and learn how to fix the issue, even if imperfectly. What might seem like a small thing (for example, for loops), may turn out to be critical later. Instructors and TAs have office hours. Make full use of this.

  • Get a tutor. There's no shame in getting a tutor. Think of a tutor as a coach. I am a professor with 25+ years of experience in CS, but if I have an unresolved question or something I can't resolve by myself (I do try), I seek help from my colleagues immediately. Why wait? There's so much to learn, and it's fun to learn from others.

  • Practice secretly. OK, inspite of my telling you not to compare yourself with peers, you still do. Can you do something about doing well in comparison? Absolutely. Practice secretly. Talk to your tutor about ways to do this.

  • Do lots of tiny problems. Skill development of any kind involves practice, and most practice in any skill development involves small exercises. The wrong way to learn "loops" is to try and solve a few challenging loop problems. The right way is to solve dozens of small loop problems. Where can you get these? See my CS-1111 material, for example, and do the in-class exercises in the modules. All of them are tiny and worth doing.

  • Mental execution. Some of the exercises above involve mental execution of programs. This is an essential practice exercise. Not enough of it occurs in intro courses, unfortunately.

  • Use the break. Make optimal use of the time between semesters to go back and fix past issues, and practice on small problems.

  • Positive inner dialogue. It sounds corny, but it really helps to develop a positive attitude. If your inner dialogue is "Oh, this is so hard, life is tough, I'll never get it", you'll only be making the challenge worse. Better to think "Yes, it's hard but it's a skill anyone can acquire reasonably well, so I'll eventually get it" and even better "Doing this will prepare me for life's other challenges".
How will you know it's working out? How will you know when you "get it"? One issue is that courses in CS get more challenging as you proceed in the curriculum. (They need to, else how would would we be improving your skill level?). So, if you are feeling challenging all the time, it can be hard to feel like you "get it" in a particular course. The best way is to look back at an earlier course. You will be surprised by how easy it will look to you when you are in a later course. You will say to yourself, "I can't believe I found it hard". That's just the nature of skill development: once you have it, you have it.

More advice on CS