Written by Wei Song & Wei Qing
Typesetting by Dastin
Computers play an irreplaceable role in various fields, including scientific research and finance, and programming ability is an important criterion for many laboratories when selecting students. Even if you may never use C language again, this 4-credit course is still very important as an introductory programming course.
In today’s study guide, the senior will talk about how to learn C language.
1. Initial Reading of the Textbook
This is the first stage, which is the foundation for learning c. The focus is on the initial understanding of programming in c language, which means giving commands to the computer to perform corresponding operations; to put it simply, it is about communicating with the computer using a specific language. Therefore, we should understand, or memorize, the functions that can be achieved by each statement and the statements that can be chosen to achieve a certain function (just like translating between English and Chinese).
To really use c language well, it is particularly important to memorize the “statements we can choose to achieve a certain function.” If you can grasp the differences between similar functional statements at this stage, it would be even better. However, at this stage, I personally think that many functional statements and algorithm ideas are not significantly different, so I suggest choosing one commonly used, easy to understand, and mastering it well, for example, I often use the while statement for loops.
Listening to the teacher explain examples is undoubtedly a good way to understand the corresponding functions of c statements. If you are attentive enough in class, you can completely skip the skim reading of the textbook; of course, at this time, you can also read it carefully, finding some small knowledge points. However, due to insufficient knowledge reserves (for example, not having learned pointers and functions), I personally think that careful reading at this time is not very meaningful, while careful reading after learning is very necessary.
2. Homework and Practical Exercises
Practice is the only criterion for testing truth, just reading example programs is naturally theoretical, and practice is essential. Homework and practical exercises are complementary to listening in class when learning c language, especially practical exercises, which play a significant role. First, it reinforces memory and deepens understanding. Writing a practical small program using the knowledge you have learned naturally helps deepen memory and also gives you a sense of achievement, providing motivation to continue learning; second, it tests what you have learned. Even though the textbook and ppt are written clearly, understanding is inevitably biased; at this time, a build can tell you whether the program you have written is correct.
3. Read the Textbook Again
After completing the initial learning of C language (basically able to write all programs required by the course without any reference), you need to further improve what you have learned, because the textbook hides many small knowledge points that may have been overlooked during your initial learning due to infrequent use. In addition, after learning about pointers and functions, when you read the textbook again, you can not only understand the content that was beyond the syllabus before (the textbook may involve examples related to functions before the functions are taught; understanding arrays requires knowledge of pointers), but also deepen your understanding by solving previous problems with later knowledge. Of course, it is worth noting that when encountering problems, you should first verify them practically, because it is very likely that these are misunderstandings that you did not discover during your first learning.
Moreover, the teaching materials that accompany the class may be outdated, and may not include the new standards of C language, which could cause inconvenience when programming. If you want to maximize your programming ability rather than just getting a good score, you can borrow one or two related books from the library for self-study.
Recommended Books:
C Primer Plus
K&R’s The C Programming Language
(This book is not very suitable for absolute beginners)
4. Practice, Practice, Practice
After completing the above basic learning, you can improve yourself by reading programs, which means doing exercises. You can use the usual method of practicing problems to fill in gaps and deepen understanding, or you can improve by writing and debugging programs.
I won’t elaborate much on practical exercises here; I will briefly introduce what types of exercises to do. When I started doing exercises, it was one month before the final exam. For mastering fragmented knowledge points, you should do fill-in-the-blank and multiple-choice questions; if you make mistakes, you should refer to the textbook, search online, or consult experts or teachers; for exercising program comprehension, you should do exercises that require reading programs and writing out the running results. If you make mistakes, read carefully again; if you still don’t understand, you should check the correctness of the answers practically and consult experts or teachers around you.
If you want to score high in the final exam, I suggest the following:
1. Memorize programs with fixed patterns, such as linked lists and bubble sort (for sorting programs, it is recommended to choose the one you understand best; it is best not to use bubble sort this time and selection sort next time)
2. Write and debug large programs from the textbook, past exam questions (which can be purchased from Happy English Bookstore), and the practical guidance book, striving for correctness on the first try (not all large programs, just practice those with unique or rare algorithms, like linked lists, which are time-consuming and labor-intensive, and it is recommended to memorize them without further practice)
3. Master some knowledge points, such as precedence, by heart.
5. One More Thing…
Regarding practicing problems, I would like to recommend Tan Haoqiang’s book, a green exercise collection (he has quite a few exercise books, and I am not sure about others, but I think this one is quite good; however, I felt there were some errors in it while doing exercises, not sure if it was my misunderstanding). The exercise collection can be borrowed from the west side of the fourth floor of the East Library.
If you are a complete beginner in programming and hope to find a way to spend less time in this course while still getting a satisfactory score, sorry, I haven’t thought of one yet. If you have a programming background, you can directly inform the teacher, generally speaking, you can be exempted from a semester’s practical class hours and homework, and only need to submit a major project to the teacher and take the final exam, because the teacher knows you have a foundation, so the score will not be low.
In summary, if you want to start learning C language from scratch, you need to read more examples, practice more, and think more (especially for the chapter on pointers, carefully consider the structural relationships between them); only in this way can you gradually understand and master C language.
To find out the location of Tan Haoqiang’s exercise collection in the library, please click “Read Original” to check.
The end of this article.