Computer Science Learning in Undergraduate Studies
Machine-translated from Chinese. · Read original
Original Post on Wuse Tu BBS
Original Post: I’m a sophomore majoring in mathematics. To be honest, I’m interested in computer science. Since my first encounter with it, I’ve been fascinated. However, during the college entrance examination, I didn’t think much and chose to major in mathematics, thinking it wouldn’t be difficult to switch majors later (but in reality, the courses in this major are very challenging).
Now that I’ve thought it through, I’ve decided to learn computer science. Although I don’t have the opportunity to switch majors, it’s not a big deal. I want to take as many computer science courses as possible or learn what I need to know, so I’m seeking help here. I hope to get a copy of the computer science department’s course schedule for next semester and meet some friends from the computer science department. I also want to attend some of their classes. Additionally, I’m interested in developing in the direction of programming, specifically network programming or mobile app development.
Currently, my computer science foundation is weak. I’ve only learned computer basics (which I think is not very useful), C language (I got a perfect score on the final exam, but I think the exam was too easy), and MATLAB (which can’t even be considered a computer science course, and I got 90% on the final exam). I know I should learn database, computer principles, assembly language, computer networks, computer systems, and Java. Next semester, I’ve also selected courses on data structures and computer networks. However, I still feel that my self-study is too amateurish, and I want to learn from professionals.
During the holiday, I want to work hard to make up for what I’ve missed, so I can attend computer science department courses directly when school starts. Therefore, I want to know more about the computer science department’s course schedule. I want to know what courses everyone takes in the first and second semesters, and so on.
Additionally, I’ve learned discrete mathematics and numerical analysis in the mathematics department, which should be helpful for computer science. My math foundation is okay, and my grades are among the top in the department, but our school’s math department is not very good, which is a fact.
My Reply:
I’m not a computer science major either, but I’m also interested in computer science (especially hacker technology^^, it’s very cool). After three years of university, I’ve accumulated some experience, and I’d like to share my thoughts. Please correct me if I’m wrong.
As zengjing said, the most important task in learning programming is to master the underlying ideas. Once you’ve grasped these ideas, you’ll find that all programming languages, such as C, C++, Java, Assembly, and Python, are designed based on these ideas. All you need to do is remember the simple syntax. Therefore, if you want to learn computer science well, you should first understand the ideas of object-oriented programming (OO) and functional programming (FP) during your university years, and then master one programming language.
Looking at your exam scores, I can see that you have great potential for learning computer science (although getting a perfect score is not easy, it requires attention to detail and good analytical skills). As a mathematics major, you naturally have an advantage in math. I think you should make the most of your strengths.
In terms of computer science learning, MIT students used to learn a course called “Structure and Interpretation of Computer Programs” (SICP) in their first year. This course teaches a language called Scheme (similar to Lisp) and covers a lot of functional programming content. This book is a classic, and reading it requires a good math foundation. Now, Peking University’s math department has also opened this course to undergraduates. I suggest you buy this book (中文版资料及评论), and you can also download MIT’s English teaching videos online. If you can finish reading this book, you can say you’ve initially grasped the ideas of FP. Don’t underestimate FP; there’s a language called Erlang that uses FP ideas, and it plays a crucial role in parallel computing. You can see the popularity of dual-core and multi-core CPUs, and most programs can only use one CPU, lacking parallel processing capabilities. You can search for specific information and decide whether you need to learn it.
Next, I recommend learning C++ or Java, which are based on object-oriented ideas. OO ideas are very important and are the most commonly used today. It seems you haven’t learned C++ or Java yet, so learning these two languages is also crucial. Don’t rush to learn everything at once; first, master the OO ideas. Once you’ve grasped OO ideas, you’ll find that you can understand almost all the popular program codes today (even if you don’t know the syntax details). For OO learning methods, I suggest you search online and arrange your own schedule. I learned VC++ during my first-year summer vacation and touched on some OO ideas (I read Sun Xin’s book and videos), but I didn’t fully understand it (I’m a bit slow^^). Later, in my second year, I took Professor Lei Hongzhou’s Java course and learned OO ideas again (I felt I had some insight this time). Finally, in my second year, we had a required C++ course, and I learned classes and objects again – this time, I really mastered it (thanks to the exams^^). You can refer to my experience, but I strongly recommend not starting with VC++.
As for books, for Java, I recommend Sun Wei Qin’s “Java Object-Oriented Programming”. For C++, I recommend… well, Tan Haoqiang’s “C++ Programming” (don’t laugh at me, I really haven’t read “C++ Primer”^^). Note that Tan’s book is relatively thin and doesn’t repeat the C language content you’ve learned before, so you can directly enter the OO world without relearning int, long, double, etc. (our C++ course was like that, spending more than half the time on C++/C language basics, mixing procedural and object-oriented programming… it’s hard for beginners to learn).
Book-related links:
After discussing the two important ideas, let’s talk about how to make the most of your math strengths. I think the connection between math and programming is data structures and algorithms, so these two areas should be your main focus. I recommend learning data structures in advance because I think the course might not be offered (I selected it for three semesters, and it was finally opened because a few students from the School of Electrical Engineering wanted to take it, but there were only 11 students, and the school almost canceled the course). The data structures textbook I used is http://www.douban.com/subject/2013616/. It uses C++ and covers STL, but if you haven’t learned C++, it might be difficult to understand.
As for algorithms, I’m a complete outsider (my math is not good), but I’ve been wanting to learn it recently. I recommend a few books:
- “Introduction to Algorithms”: http://www.douban.com/subject/1885170/ (it’s too thick, but it’s a classic and a must-read eventually)
- “Algorithm Basics”: http://www.douban.com/subject/1671885/ (it’s thinner, but I’m not sure how it is)
- “Program Algorithms and Techniques”: http://www.douban.com/subject/3076937/ (it’s all C code and has a sense of fun, making it more practical and less boring)
- “New Practical Algorithm Analysis and Programming”: http://www.douban.com/subject/3070758/ (it’s an advanced book, used as an internal training material for ACM at Fudan University)
The most efficient way to learn algorithms is not to bury your head in books but to solve actual problems. I strongly recommend registering on these two websites to practice:
(
Zhejiang University ACM: http://acm.zju.edu.cn/onlinejudge/ Peking University ACM: http://acm.pku.edu.cn/JudgeOnline/
These two websites have a large number of problems. After completing each problem, you can submit your code for judgment to see if it passes. Only after completing all the problems on these websites can you be considered an algorithm expert. Keep practicing:)
Finally, I’d like to add a few more points, which may not be well-organized or entirely correct:
- To learn computer science well, you need to use Linux. Check out the Linux section for more information. You must install a dual-system, not a virtual machine. Do your programming under Linux.
- In the internet age, it’s essential to learn web development. It’s crucial for showcasing your skills. You should master HTML+CSS+PHP and have your own blog or website.
- Python is a great language that can do many things, especially for quickly developing small tools. I recommend learning it (it’s a simple language).
- Assembly language is not that important unless you want to develop system-level applications, work with hardware, or become a cracker. If you need to learn it, my first recommendation is Wang Shuang’s “Assembly Language”, followed by “Computer Level 3 PC Technology” (haha, this is an exam, not a book), and then “The Art of Assembly Language”. However, I suggest only gaining a basic understanding, as this is not your strong suit, and you shouldn’t spend too much time on it.
- Mobile app development uses Java, but I’m not interested in it, and I don’t know much about it. Additionally, I’m not optimistic about it:)
- For databases, it’s enough to know how to use them. If you want to become a DBA, you can delve deeper into the subject. Otherwise, learning basic CRUD (Create, Read, Update, Delete) operations during university is sufficient.
- The quality of university teachers varies. Don’t rely solely on elective courses for your learning plan. Computer science is a field of study, not just a major. Books, online videos, online resources, and hands-on programming are the most important things. Teachers can only guide you to the door (note: not through the door), and it’s up to you to enter and delve deeper.
- If you don’t believe what I’m saying, think about how many MATLAB commands you still remember:) Can you confidently say you’ve learned MATLAB? Reading books and practicing are crucial.
zengjing (another expert’s response): Actually, computer science requires a strong mathematical foundation, especially if you want to study it in depth. For example, theoretical computer science can be considered a branch of mathematics. You can google “Turing machine” and “recursive function” to discover many interesting things. If you want to learn computer applications, you may not need to study it that deeply. The basic computer science courses include operating systems, compiler principles, data structures and algorithms, programming languages (such as C, C++, and Java), discrete mathematics, and network fundamentals. Many people who work in the computer industry are actually just coding workers, which can be very tiring and not well-paid. In my opinion, since you’re still in your second year, you have a lot to learn and should focus on building your foundation. Don’t be superficial or follow the trend. Learn mathematical analysis, advanced algebra, abstract algebra, real analysis, complex analysis, functional analysis, and topology, as these will be useful for your entire life. The computer industry may seem trendy and fast-changing, with new technologies emerging all the time. However, I can assure you that these new technologies are essentially the same, just with different designs and optimizations. The essence of computer languages is Turing equivalence, meaning you can use any language to get things done. The difference lies in the design philosophy and optimization for different development needs. Therefore, learning C, which is not as trendy, can still be useful, and it’s a fundamental language for system development. You need to work hard to master it. As for object-oriented Java, mastering the concept of object-oriented programming is more important than the language itself. Additionally, generic programming and frameworks are not difficult to understand (you can search for them), and Java provides a large number of functions that can greatly reduce the burden on developers, making us more “lazy”. Here, I must mention the importance of reinventing the wheel, such as sorting functions in Java, which are numerous and don’t require you to write them from scratch. However, if you haven’t implemented these basic algorithms yourself, your abilities will improve slowly, and you’ll only learn how to build blocks. It’s essential to practice hands-on, regardless of whether you’re learning mathematics or computer science. The principle is the same: you can’t learn without practice. There are many experts online, such as the owner of this blog: http://blog.youxu.info, who is a Ph.D. in computer science. He turned down Google’s offer to study in the United States. Read his articles to see the depth of his knowledge and his passion for his field. Learning requires passion, not just passive acceptance. Recently, there’s been a lot of discussion about the minimum Manhattan network problem, which was solved by a computer science student from Fudan University. It’s worth thinking about. Douban is also a great resource, at least for finding out what books people are interested in.
Oh, I forgot to mention that the internet we use every day is essentially an application of graph theory and optimization algorithms. Learning to see problems from a mathematical perspective will be a valuable asset for your entire life.
PS: You mentioned wanting to learn network programming. You can refer to “TCP/IP Detailed” volumes 1 and 2 to build a foundation, and then find a book on Windows network programming. Check out china-pub or Amazon. For computer organization, it may be dry at first, but you can try reading “The Secrets of Coding” to make it more accessible. Assembly language is a tool for code optimization and reverse engineering, but I’m not an expert, so you can check out the recommendations on CSDN.
苍蝇’s response: The previous experts have said it well: building a strong foundation is the most important thing.
Mathematics is the foundation, and computer science uses a lot of mathematical concepts, such as linear algebra, which is used in computer graphics; discrete mathematics, which is used in databases and graph theory; numerical computation methods, which are used in algorithm optimization and scientific computing; advanced calculus, which is essential; and probability theory, which is used in many areas, including security and encryption.
English is also important, as most advanced technologies are described in English. You don’t need to be fluent, but you should be able to understand English texts with the help of dictionaries.
Here are some books that I think are very good, for your reference:
Assembly language: The textbook used in university is well-written, but I couldn’t understand it. There’s a book called “Professional Assembly Language” that’s good for research, but you should have a basic understanding of C language first.
C: Tan Haoqiang’s book is very good. Read it multiple times, and you’ll find it useful. Another recommended book is “High-Quality C++/C Programming Guide”, which is a book that will make you feel ashamed of your own abilities. You can also study API, such as “POSIX Programmer’s Guide” and “The GNU C Library Reference Manual”.
Java: Java is currently the most popular programming language, and it’s used in many areas. It’s easy to find a job as a Java programmer. I recommend two books: “Core Java 2 Volume” and “Java and Patterns”.
Operating System
In terms of operating systems, I believe Linux and Unix are the direction for programmers, so I recommend the following Unix-like systems.
- Understanding the Linux Kernel, 3rd Edition
- Linux Kernel Development Second Edition
- Advanced Programming in the UNIX Environment
- The Design of the UNIX Operating System
- Operating System—Thread: Optimizing threaded MPI execution on SMP
- Operating System—Thread: Implementing Lightweight Threads
- Deep Understanding of Linux Virtual Memory Management
- PRENTICE_HALL - Understanding The Linux Virtual Memory Manager
- LINUX Kernel Source Code Analysis
Networking
Nowadays, networking is inseparable from computer science, so it’s very important. The textbooks used in school are too outdated, so it’s best to find external resources to learn from. For example, Cisco’s networking textbooks are very comprehensive, such as IP Advanced Routing and TCP/IP Illustrated (3 volumes). The third volume’s T/TCP can be skipped. UNIX Network Programming (2 volumes) is also a good resource.
Scripting
Learning a scripting language is essential. Python, Perl, or PHP will do. Python is currently the fastest scripting language; Perl is a bit outdated and has a strange syntax, but once mastered, it can be very convenient and can accomplish a lot with minimal work. PHP is widely used in web development and can also be used as a scripting language. It’s crucial to learn how to use shell scripts. I recommend the book Advanced Bash Scripting Guide.
Data Structure and Algorithm
Data structures and algorithms are important but difficult to master. However, once mastered, they can be beneficial for a lifetime. I recommend the following books:
- Data Structure by Peng Bo (although it has many errors, it’s still a good textbook)
- Introduction to Algorithms (I haven’t finished reading it because my math skills are not good)
Others
Other recommended books include Design Patterns and Software Engineering.
Of course, these are mainly supplementary readings. It’s essential to grasp the required and elective courses.
There are too many books to read and too much knowledge to acquire. I suggest learning by doing and finding a part-time job or project to work on, such as building a small website or finding a part-time job.
还没有人留言,在下面说两句吧。