Advice to Computer Science students

A student wrote to me: “I am a first year student in Computer Science and I am worrying because some of my classmates already know how to program but I do not. I am afraid that I may fail. Please help.”

Answer: A journey always starts with the first step. As long as you put in the effort you will do well. Do not compare yourself with others, it always causes vexation; instead looking within yourself and ask “What efforts should I put in to overcome this challenge?”. Learning to program is like learning a new language, you have to learn the syntax, the rules, the structure and styles and you have to practice. You will make a lot of mistakes and learn from them. The more you write code, the more mistakes you make, the better you will program. In programming, you must learn everything by yourself. You will not learn much if you are dependent on someone as you must make mistakes so you can learn from them. The more mistakes you made in the beginning, the less mistakes you will made later. When I teach programming course, I tell students that I do not grade the first five programming exercises to allow students time to learn so they do not have to worry about grades. I told them: “It is OK to make mistakes; it is OK to get wrong outputs as long as you are learning from your mistakes.”

There are students who are hurry to code just to prove to friends that they can program. However you need to learn the theoretical concepts first because it will help you to understand your mistakes. Most exercises are designed to test your understanding of the programming concepts, if you do not understand these concepts, you will not develop good programming skills. Just like learning to speak English, some can speak correctly and some can speak full of grammatical errors. You need to read the textbook to understand the concept before starting to write code. You learn one concept than write code about it, test it, until you understand it before go to the next. Each concept is built on top of others so you need to develop a strong foundation first, else you may not go further. You must organize your program by plan which pieces of code (Module) you need to write first, and then implement and test them one at a time. By following a well-defined process of development, you will develop a strong programming discipline. If you build your code one module at a time then test them you may find more bugs sooner than complete the program then conduct the comprehensive test. It would also be easier to write comment to your code as you write it, so that when you come back to it later, you easily remember what you did.

Today most technology classes are using the “Active Learning” method where materials are available online prior to coming to class. Many students download these materials and skip classes as they think they can learn by themselves. Do not make that mistake! Computer class is important because that is the place where you learn from others' mistakes. Most professors will describe common mistakes, explain them, and correct them during the class. Classroom is also the place to ask questions and get correct answers from professors. Professors often give examples in class and it is better to learn from these examples than from books. Most professors, including myself, often use these examples on exams. By attending class regularly, you will do well in these exams.

To be the best programmer, you need to write code often. If you do not, you may forget what you have learned. So my advice is “write code, write code and write more code.”

Sources

  • Blogs of Prof. John Vu, Carnegie Mellon University