Acknowledgement: This article was written by Dr Leong Hon Wai for his IC101 class in July 1994. IC101 – Programming Methodology I, is very much similar in spirit to CS1101C, the only difference being that the former uses Pascal as the tool for illustrating the programming concepts.
CS1101C is a course that introduces and teaches good programming techniques and methodology. Learning to program is an activity much like learning to play tennis. It is not a spectator sport! None of the world-class tennis player reached their top rankings by reading books about the theory and practice of tennis (even though these are also important) – they all got there through constant, unrelentless practice, good coaching, and lots of trial and error. Even with lots and lots of practice, most people still do not become world-class players. However, many of them do become good enough to enjoy playing tennis.
Likewise, to be good at programming and to enjoy programming, you must practice it often, with constant coaching, and with lots of trial and error. You learn by first working on simple programs, and then work your way up to more difficult ones and the laboratory sessions are designed to help you do exactly that.
Practice makes perfect and many experts have said that the best way to the top is through Practice, practice, practice. In programming, it is also important to have lots of practice on programs of all kinds, from small ones to big ones, from simple ones to intricate ones. Practice makes perfect and constant and persistent practice allows you to learn from your mistakes. It is also important to learn good and proper programming techniques, systematic ways to program, good program design, and effective problem solving. The laboratory sessions are designed to assist you in these areas.
Therefore, all freshmen must take advantage of the fortnightly two-hour lab sessions to gain lots of practice in programming. However, as all of you will soon discover, these mere two-hour sessions are not sufficient practice. How many good tennis players you know keep in form by playing only two hours a week? Therefore, it is very important that all of you have more practice with programming either here in SoC, or at home, on the bus, anywhere and everywhere.
In tennis, it is unthinkable to ask somebody else to "practice for you". If somebody else practices, then that person improves, not you. The same thing applies to learning programming. You cannot learn programming by asking someone else to do it for you; to learn programming, you must do it yourself. Watching good tennis players play can be beneficial, but one must practice what one has observed to acquire the skill. The same for programming – reading good programs and books on how to write good programs can be beneficial, but one must also practice what one has read.
Good programming is a habit that must be acquired.
Tennis coaches have often said that they'd rather take a student who have never played the game before than to take a player who have learned on his/her own and has picked up some bad habits. The reason is obvious– the coach has to help his students "unlearn" their bad habit before proceeding to teach them proper techniques. In addition, those who have mastered another similar game (like badminton or table tennis) that requires a different use fo the arm/wrist/body find it very difficult to "switch" to tennis.
The same thing applies to programming – students who have picked up bad programming habits and techniques are much harder to teach than those who don't know programming at all. Habits die hard. Also, those who pick up opposing views on good programming habits and techniques will find it difficult to "adjust".
Therefore, students who already know programming should take special note! Be aware of your programming habits, and be willing to change the bad habits for the good ones.