English
Chapter 1 — Better to Run than Curse the Road
Starting Point
Q1: Can I learn computer science?
Yes, the only requirement is that you are willing to treat confusion as part of the work rather than as evidence that you are not suited for it.
All you need is a common computer, sustained effort, and some curiosity. Many of the best courses, textbooks, tools, documentation, and papers are available online. The problem is that there are too many resources, and finding the right ones can be difficult — this guide tries to help with that. The other challenge is how to sustain planned, consistent effort without the supervision of a school or teacher.
You do not need to feel mathematically gifted or already technical. You do need to be willing to work in small steps and not skip the steps that feel slow.
Also, there are several perhaps counterintuitive truths along this path: reputation, degrees, and professional background have little necessary relation to ability; school is far from the best place to learn; the best teacher is always yourself; and learning is a way of life, not a one-time act of hard labor.
Q2: Do I need a computer science degree?
Not necessarily. A degree is useful in certain ways, but it is not the same thing as knowledge or ability.
A degree provides access to resources, learning structure, peers, assessment, and a credential for entering the field. These are real advantages. Pure self-study has to seek substitutes deliberately: a study plan, exercises, projects, feedback, and self-testing.
In some countries, for some employers, and for most graduate programs, academic credentials matter. But if your goal is to understand the discipline, become a technical practitioner, or acquire professional competence, a degree is not directly tied to that goal.
It is also worth noting that most people in the world do not have direct access to elite universities, often because of economic conditions, regional limitations, or other constraints. But everyone can still access some of the best learning conditions online. Nearby universities or coding bootcamps may offer mediocre courses while producing several times more confusion.
The areas where self-study is hardest are those that require sustained expert feedback: advanced theory, research-level work, large systems projects, and academic writing. The areas where self-study works best are those with strong public courses, clear exercises, and immediate feedback, because a program either runs or fails.
In addition, one point must be made clear: having a computer science degree does not mean that one will necessarily become a practitioner or be hired by a technology company. There are several reasons for this:
- Degrees and grades are not fully tied to real working ability. A student who performs well in school is not necessarily an excellent employee or practitioner. A diploma from a prestigious university proves only a limited range of things.
- The abilities trained in school differ significantly from the abilities required in real production environments. Students need to develop their own “personal capabilities” outside the formal curriculum.
- Technology changes very quickly. A degree cannot cover long-term professional competence once and for all. The foundations of computer science are relatively stable, such as algorithms, operating systems, databases, networks, and programming language principles; but specific tools, frameworks, platforms, development workflows, and industry demands change rapidly. University courses are usually better suited for building foundations, and cannot continuously keep up with every new technology.
- The AI era further raises the demand for technical judgment. Knowing how to use AI tools is becoming increasingly important, but what matters more is the ability to judge whether AI output is correct, safe, and suitable for real systems. Without solid foundations, one is more likely to be misled by AI’s fluent answers.
- Between being a student and becoming a practitioner, there are still internships, projects, and portfolios. Grades mainly prove that you can complete coursework, but companies care more about whether you have worked on real or near-real projects: whether you can turn an idea into something that runs, handle bugs, maintain code, and deliver functionality. Without internships, projects, open-source contributions, or demonstrable work, even a degree may not be enough for employers to judge whether you have practical ability.
- Hiring itself is affected by market conditions and is not determined solely by personal ability. Whether technology companies hire, how many people they hire, and what positions they hire for are influenced by economic cycles, company budgets, business adjustments, layoffs, organizational changes, and regional constraints. Even with a computer science degree, a person may still face fewer openings, intense competition, shrinking graduate recruitment quotas, and stricter resume screening. Therefore, a degree can increase opportunities, but it cannot guarantee employment.
Q3: What background knowledge do I need?
The amount of background knowledge needed to study computer science is not very large. But to make these requirements fully visible, let us begin with an extreme case: suppose someone has never used a computer before and has only a middle-school level of education. What would they need to know before formally studying computer science?
-
Basic familiarity with computers. This can usually be acquired by using a computer more often and trying out different functions. Do not be afraid of “breaking” the computer by experimenting with it. A beginner is unlikely to destroy a computer completely, especially through ordinary software use. This includes:
- working with
filesandfolders: understanding what files, folders, paths, and file extensions are; - installing and uninstalling
software; - using a
browserto search for problems and find official documentation; - using a
text editorto edit documents, and using compression tools to compress and extract files; - knowing what
programming toolsandterminal toolsare used for, and understanding their basic usage; - typing fluently. The English keyboard, uppercase and lowercase letters, and symbol input are all important. Programming uses many symbols, such as
(),[],{},;, and:.
- working with
-
Basic English reading and writing ability, together with the ability to use an online dictionary. A large number of tools, error messages, documents, commands, and function names are written in English. With a vocabulary of around 2,000 words, you can already handle most beginner-level programming study reasonably well. This is roughly the level of someone who has studied English as a second language for three years. But English ability will significantly affect your upper limit.
-
Middle-school level mathematics.
- arithmetic operations, parentheses, negative numbers, decimals, fractions, and percentages;
- equations and functions;
- sets and relations, including concepts such as “belongs to,” “contains,” “intersection,” “union,” and “mapping”;
- basic logic, including “and,” “or,” “not,” and “if…then…”.
These things are usually not taught in university, yet many new university students feel frustrated and want to give up precisely because they lack this basic background. Some of this knowledge can be acquired through MIT’s course The Missing Semester of Your CS Education, but that course is not designed for absolute beginners.
Beyond this, there is another foundation that is very easy to overlook: the ability to handle errors. Many beginners feel deeply frustrated the moment they see a screen full of errors after running their code, and they quickly lose the motivation to continue. But the ordinary rhythm of learning computing is: write code → get errors → look up the errors → modify the code → get more errors → modify it again → finally make it run. So before you begin, you need to establish one basic idea: an error message is not a failure, but a necessary part of the process; the program or runtime environment is telling you where something does not follow the rules.
Compared with most disciplines, this entry threshold is genuinely very low. These basics alone are enough to make your computer skills come alive and begin producing real output. But English and mathematics determine the upper limit of your ability. They are subjects that require continuous investment and continuous learning. Every bit of effort you put into them will return to you in some form later.
Q4: Can I learn computer science without a math background?
Yes, but not by avoiding mathematics.
You can begin programming with only a little mathematical background. Programming will give you confidence, feedback, and concrete experience. But if you want to understand algorithms, artificial intelligence, machine learning, cryptography, graphics, formal methods, or theoretical computer science, mathematics becomes the foundation of everything.
The practical sequence is this: learn programming first, or learn programming alongside discrete mathematics; then study proofs, linear algebra, calculus, probability, and statistics according to your goals. Do not try to swallow all of mathematics before writing code. But do not assume that programming ability will automatically replace mathematical ability either.
Q5: How long does it take to study computer science seriously?
It depends on the goal.
To become productive in programming, you need several months of consistent effort. To build foundations solid enough to move across different subfields, you need one to two years of serious study. To reach real depth in systems, AI, theory, security, graphics, or any other specialized direction, you need years of learning and practice. This is normal for a serious discipline.
For a self-learner, the realistic pace is to study one major topic at a time. Beyond the learning materials themselves, each topic should also produce something: problem sets, small practice projects, notes, or summaries of papers.
For students who have just graduated from high school, I want to clarify one thing: learning efficiency and time limits will no longer be your main difficulties. This is easy to understand. The only standard of exam-oriented education is the result of a particular exam at a fixed time. But learning computer science, like life itself, is an infinite game.
In Finite and Infinite Games, James P. Carse defines an “infinite game” as a game with no final ending, played not for winning or losing, but for the purpose of continuing the game better. Finite players want to turn life into a score that can be settled; infinite players want to keep life open as creation. What you will face is an exploration without a final endpoint, a form of free creation. You can choose the form in which you want to exist and act, rather than being defined as an “object” that acts under supervision and evaluation in order to satisfy a standard.
In the finite game of school, the only important thing is to perform the role of “student” as perfectly as possible. The rules of school are fixed, limited, and closed. But the world is not a performance show. This is especially clear for students learning computing: learning does not merely give you knowledge; it gives you real-world power, the ability to create value, and even a form of agency. Making clear decisions, creating value, exchanging value, and understanding the world are far closer to the essence of life than merely playing the role of a good student.
How to Use This Guide
Q6: What is this guide, and who is it for?
This is a structured map of computer science as a discipline. It tries to cover all major areas related to computer science and to list high-quality resources for each of them. It is suitable for several kinds of readers:
- beginners with almost no background;
- self-taught programmers who want to fill gaps in their knowledge;
- working engineers who want a deeper understanding;
- AI-focused learners who need stronger foundations;
- people from adjacent fields who want to understand computation seriously.
The only thing it requires is that you are willing to practice, willing to read difficult material, and willing to return to prerequisites when later topics stop making sense. This guide is not meant to be read from beginning to end like a novel. It is a map. You use it to understand the landscape, choose a path, and then spend real time working through the resources and exercises.
Q7: Do I need to read it in order?
No. You only need to pay attention to the prerequisites listed at the beginning of each section. Chapter 2 is the foundation for almost everything else. After that, the paths begin to diverge.
Q8: What should I choose to study?
Almost every type of reader shares the same common spine:
CS50x / Berkeley CS 61A —— MIT Missing Semester —— MIT 6.042J —— MIT 6.006 —— CSAPP
After completing these foundational courses, you should be able to write small programs independently, debug errors, understand common data structures and algorithms, read basic mathematical notation, and form an initial understanding of branches such as operating systems, networks, databases, and AI. The next step should not be to go deeper blindly, but to choose a path according to your goals.
- Web Frontend Development: MDN Learn Web Development —— The Odin Project —— Full Stack Open —— You Don’t Know JS Yet —— PortSwigger Web Security Academy.
- Backend Development: the backend sections of Full Stack Open —— databases and SQL —— basic system design —— API design, authentication, and authorization —— CMU 15-445/645 —— MIT 6.5840.
- Full-Stack Application Development / Software Engineering: The Odin Project —— Full Stack Open —— Software Engineering at Google —— Refactoring —— reading and maintaining open-source projects —— testing / CI / code review practice —— a complete product project.
- DevOps / Operations / SRE: Linux / shell practice —— computer networking —— Docker —— Kubernetes Tutorials —— AWS / GCP / Azure fundamentals —— observability —— Google SRE Book / Workbook.
- Data Analyst: SQL —— Berkeley Data 8 —— statistical inference —— data visualization —— A/B testing —— business analysis projects.
- Data Engineer: SQL —— data modeling —— batch processing / stream processing —— Airflow / dbt —— cloud data warehouses —— CMU 15-445/645 —— distributed systems.
- AI Application Developer: Python —— API / web fundamentals —— Hugging Face Course —— LLM application frameworks —— RAG / agent projects —— deployment and evaluation.
- Machine Learning Engineer: linear algebra —— probability and statistics —— Stanford CS229 / MIT 6.036 —— MIT 6.S191 —— Full Stack Deep Learning —— MLOps Zoomcamp.
- LLM / NLP Engineer: Stanford CS229 —— MIT 6.S191 —— Stanford CS224N —— Hugging Face LLM Course —— Stanford CS336 —— reproducing LLM papers.
- Computer Vision Engineer: linear algebra —— Stanford CS229 —— MIT 6.S191 —— Stanford CS231n —— vision projects —— deployment and optimization.
- Database / Storage Systems Engineer: CMU 15-445/645 —— reading the source code of SQLite / PostgreSQL —— distributed systems —— storage engine projects —— transactions / logging / replication.
- Systems Programmer / Operating Systems Track: C / Rust —— Nand2Tetris —— deeper work with CS:APP —— MIT 6.1810 —— compiler / networking / distributed systems electives.
- Embedded / Low-Level Development: C —— computer organization —— operating systems fundamentals —— microcontroller projects —— RTOS —— communication protocols.
- Network Programming / Network Systems: computer networking —— socket programming —— protocol implementation projects —— network performance analysis —— distributed systems —— SRE practice.
- Cybersecurity: web security fundamentals —— PortSwigger Web Security Academy —— systems fundamentals —— pwn.college —— MIT 6.858 —— Cryptography I.
- Android Mobile Development: Android Basics with Compose —— official Android Training —— Kotlin —— networking / data storage —— architecture and testing —— a complete app project.
- iOS Mobile Development: Develop in Swift —— Stanford CS193p —— SwiftUI —— networking / data storage —— architecture and testing —— a complete app project.
- Game Development: choose either Unity or Unreal —— Game Programming Patterns —— linear algebra —— physics / animation / input systems —— LearnOpenGL —— small game projects.
- Computer Graphics: linear algebra —— LearnOpenGL —— graphics textbooks —— renderer projects —— GPU / shaders —— physically based rendering.
- Robotics / Autonomous Driving Foundations: linear algebra —— probability —— Modern Robotics —— control —— state estimation —— path planning —— visual perception.
- Programming Languages / Compilers: functional programming —— PLAI —— Nand2Tetris Part II —— compiler courses —— type systems —— program semantics.
What Computer Science Is
Q9: What does computer science include?
Computer science is built on programming, algorithms, and the necessary mathematics. After that, it can be summarized into four directions: computation, systems, intelligence, and applications.
-
Computation. What can be computed? By what methods? How many resources does computation require? Are there limits to computation? This includes computability, complexity theory, formal languages, automata, algorithm analysis, logic, type theory, programming language theory, semantics, and formal methods. This is the area where mathematics and computer science are most deeply connected. Algorithms, cryptography, programming language theory, and formal verification all depend heavily on this direction.
-
Systems. How do we build, understand, and operate complex systems made of many interacting parts? This includes computer architecture, operating systems, networks, database systems, distributed systems, concurrent programming, compilers, container orchestration, observability, embedded systems, and high-performance computing. The difficulty here usually does not lie in any single concept, but in keeping a system understandable, controllable, and maintainable when many parts run at the same time, share resources, fail, and affect one another.
-
Intelligence. Can computation produce intelligence? If so, by what mechanisms, and with what limits? This includes artificial intelligence, machine learning, deep learning, large language models, natural language processing, computer vision, reinforcement learning, robotics, knowledge representation, automated reasoning, interpretability, AI safety, and alignment. It is also the area of computer science most directly connected with cognitive science, philosophy, linguistics, and neuroscience.
-
Applications. This is not “lower-level” work or “just writing business code.” It is the combination of the abilities above in concrete settings. Web development, mobile development, game development, graphics, cybersecurity, cryptography, robotics, scientific computing, human-computer interaction, DevOps, SRE, data analysis, data engineering, AI application development, database engineering, systems programming, and embedded development are all combinations of different directions. For example, machine learning mainly combines intelligence and computation, while depending on data; databases combine systems and part of computation; cybersecurity combines systems, computation, and engineering practice; AI infrastructure involves almost all directions at once.
The importance of data-related research is rising with the development of artificial intelligence. Modern AI depends heavily on the scale, quality, structure, and processing of data. As a result, databases, data engineering, information retrieval, data cleaning, data labeling, data governance, and representation learning are becoming increasingly important. But from the perspective of learning computer science, data is better understood as a core object that runs through multiple directions.
This guide is organized according to this rough but useful classification.
Q10: What is the relationship between programming and computer science?
Programming is the most basic and most commonly used tool for learning computer science. Much of computer science eventually has to be tested, implemented, and used through programs; but programming is not everything. One must also go further and learn what computers can do, how to make them faster and more reliable, how data is stored and transmitted, how programs run inside computers and networks, and whether machines can show some form of intelligence. So learning computer science usually begins with programming, but it should not stop at “being able to write code.”
Q11: What is the difference between computer science and software engineering?
Computer science is more concerned with principles: what computation is, why programs run, why algorithms work, why systems fail, and how data is organized. Software engineering is more concerned with practice: how to work with others in real projects and build, modify, and maintain software reliably. The two are closely related and have many overlapping areas.
Q12: How long is the shelf life of computer science knowledge?
In computer science, the most durable knowledge is foundational knowledge, such as abstraction, recursion, algorithmic efficiency, data structures, probability, operating systems, databases, and networking principles. These do not lose their value just because a framework or tool becomes outdated.
Tools, frameworks, platforms, and fashionable technologies change quickly. A tool that is popular today may no longer be popular a few years later. But if your foundations are solid, switching tools is mostly a matter of becoming familiar with new usage; if you only have tool experience, you can easily lose direction once the tools change.
Q13: What can I actually do after learning computer science?
After learning computer science, you can write programs, build websites, develop applications, analyze data, build AI systems, understand networks and computer systems, and automate repetitive work. More importantly, you can turn ideas into reality and understand the principles behind technology, instead of merely using tools made by other people.
Why Learning Computer Science Feels Difficult
Q14: Is learning computer science really difficult?
I have already mentioned some of the “difficulties” one may encounter when learning computer science. Here they are again:
- not having access to the best learning materials;
- underestimating the absence of basic computer skills;
- following the wrong learning order or skipping steps, which leads to missing the prerequisites needed for later concepts;
- treating “errors” as evidence that one is not suited to learning, rather than as a normal part of the work, and therefore feeling frustrated;
- struggling to shift from exam-oriented learning to open-ended learning;
- neglecting practical output and hands-on ability, and only studying theory and courses;
- failing to invest time and energy consistently;
- personal psychological factors such as efficiency anxiety and self-limitation.
All these “difficulties” suggest that computer science is not, in itself, an especially difficult discipline. Or more precisely, the real difficulty often does not lie inside computer science as a field. Most people with strong professional ability would agree with this.
Q15: What does learning computer science actually feel like?
Learning computer science is a bit like building with Lego.
At first, you are facing a pile of scattered pieces. Each individual piece does not look very difficult. From the shape of these pieces alone, you cannot infer what the final work will look like. Much of the time, you are simply following the instructions step by step, but you do not know why the pieces have to be put together in this way, or what you will eventually be able to build.
Mistakes are normal, and repeated attempts are the solution. If one piece is missing, placed incorrectly, or turned in the wrong direction, the whole structure may get stuck. Learning computer science is similar: one small mistake can stop a program from running, and one concept that has not been fully understood can suddenly make everything that follows feel chaotic.
Its pleasure is delayed. After repeated attempts, at a moment you may not have expected, the scattered pieces suddenly connect. You begin to see the structure. You begin to understand why this part must be this way and why that part cannot be that way. Gradually, building with Lego changes from patiently following tutorials into a creative game in which you can control, combine, and create freely.
So the feeling of learning computer science is not one of moving forward smoothly all the time. It is long periods of confusion, getting stuck, and trying again, in exchange for certain sudden moments of clarity.
Q16: How can I remember what I have learned?
The foundations of computer science are numerous and varied. More importantly, the ultimate goal is to solve problems, not to pass a closed-book exam. So instead of relying on brute-force memorization, one should adopt smarter strategies:
-
Build a personal note-taking system. Organize concepts, commands, code snippets, error records, project experience, resource links, and your own understanding. Notes are not for copying tutorials. They are for preserving your own thinking: what problem this concept solves, what it is easily confused with, where you once got stuck, and how you eventually understood it. Good notes are continuously updated as you learn, rather than written once and then sealed away.
-
Write implementations. Many ideas in computer science only become truly clear when you write them yourself. If you are learning stacks, write a stack. If you are learning hash tables, write a simplified hash table. If you are learning interpreters, write a tiny expression interpreter. If you are learning networking, write a simple server. This is the value of resources such as
build-your-own-x: by rebuilding tools such as databases, Git, Docker, interpreters, and search engines from scratch, you take apart the things you usually only know how to use. -
Review regularly, but do not merely reread the original material. Rereading creates familiarity, but familiarity is not the same as mastery. A better method is to wait for some time, close the material, and then try to explain the concept again, rewrite the core code, or solve a similar problem. Spaced repetition and retrieval practice are both widely used to improve long-term memory.
-
Record errors. In computer learning, errors are not garbage information. They are among the most valuable learning materials. A path error, a type error, a failed environment setup, or a wrongly written recursion all show that there is a gap between your model and the real mechanism.
-
Read code, documentation, and good projects. If you only write your own small programs, it is easy to remain at the toy-project level. By reading real code written by others, you can see how mature programs organize structure, name things, handle errors, split modules, and write tests.
-
Accept long-term repetition instead of expecting to finish everything in one pass. Computer science is not knowledge that ends after you study it once.
Q17: How should I practice?
Write implementations.
Q18: How do I know whether I understand something?
You can correctly write an implementation.
Q19: What are some common stereotypes, biases, and misunderstandings about computer science?
❌ People who study computer science can all fix computers: Learners often become able to “solve” certain software and operating-system problems on their own through practice, but they do not systematically learn how to repair electronic devices.
❌ If you were not a “programming god” before university, it is already too late to learn in university: This idea usually comes from some new university students’ blind admiration for “competitive-programming gods.” They mistake “starting early” for “learning well,” and use this idea as an excuse not to try, comforting themselves when they feel frustrated during learning. Because of the “self-fulfilling prophecy” effect—believing from the beginning that one cannot do it, therefore not trying or investing effort, and finally failing, which then seems to prove the original belief—this claim may occasionally appear to come true. The real situation is that people encounter the path at different times and specialize in different skills. With the right learning path, repeated attempts, and real action, anyone can become a “programming god.”
❌ Graduates from prestigious universities are usually technical masters: This idea confuses a school’s ability to select students with a person’s real technical ability. In reality, ability depends heavily on the individual and usually cannot be determined by labels or reputation.
❌ Programmers are all isolated, stay-at-home people who only deal with computers: This stereotype comes from the fact that computer work does require long periods of concentration, but it ignores that software development itself is a highly social and collaborative activity. In reality, programmers do not only write code; they also understand requirements, explain designs, participate in discussions, accept code reviews, write documentation, and maintain systems together with other people.
❌ The faster someone types, the higher their level is: Excellent programmers spend a large amount of time understanding problems, designing structures, reading code, and debugging errors. What truly determines ability is not typing fast, but thinking clearly.
❌ Excellent programmers rely on memorizing syntax and APIs: This idea is an imagined opposite created from mocking “copy-and-paste programmers.” Solving problems is the real work. Not remembering every piece of syntax or every API is normal.
❌ Hackers are people whose computer screens constantly scroll with letters: This is a performance style from movies and TV shows. In reality, security research is more often about understanding systems, finding vulnerabilities, testing hypotheses, reading code, analyzing protocols, and writing tools. It is not about watching random text flash across a screen.
❌ After AI appeared, learning programming and computer science became unnecessary: This idea mistakes “AI can generate code” for “humans no longer need to understand code.” In reality, AI makes first drafts easier to produce, but judging whether something is correct, safe, maintainable, and suitable for real scenarios still requires computer science foundations.
❌ The first language must be Python: Python is indeed suitable for most beginners because its syntax is simple, resources are abundant, and its applications are broad. But the first language can also be JavaScript, Scheme, Java, C, or another language. What matters is the quality of the course, the intensity of practice, and whether you truly understand basic concepts such as variables, functions, control flow, and data structures.
❌ C is very low-level, so everyone must learn C first: This idea turns one valid path into the only possible entry point. C is very useful for understanding memory, pointers, and systems, but beginners can also first use Python, Scheme, or JavaScript to build programming thinking, and then return to low-level topics later.
❌ If you do not know mathematics, you cannot begin learning computer science: This idea mistakes “deep study requires mathematics” for “you must finish mathematics before you can start.” In reality, you can first learn programming to gain feedback and confidence, but if you later want to go deep into algorithms, AI, cryptography, graphics, and theory, you must gradually make up the mathematics.
❌ Building a webpage or an app means you already understand computer science: This idea mistakes “being able to build something” for “understanding the underlying principles.” Projects are important, but if you do not understand algorithms, databases, networks, systems, and security, the fact that a product runs does not mean you truly understand it.
❌ If copied code from the internet runs, the problem is solved: Copying code can only solve the immediate problem. Only when you can explain why it runs, where it may go wrong, and how to modify it do you truly own that piece of code.
Computer Science and AI
Q20: Given how powerful AI has become, is learning computer science still worth it?
Yes. AI has changed the value of computer science knowledge, but it has not eliminated it.
AI tools can generate code, explanations, tests, summaries, and prototypes. This makes shallow code production less scarce and makes judgment more important: knowing what should be built, whether the generated solution is correct, what assumptions it depends on, how it may fail, how to test it, how it affects users, and how it fits into a larger system.
Learning computer science answers many foundational questions: what a computer is, why programs run, why algorithms can be faster or slower, why systems fail, why data must be organized in certain ways, why AI works, and why it fails. AI can help you write code, explain concepts, and generate solutions, but if you have no underlying knowledge at all, it is difficult to judge whether its answer is correct, and you may not even know which layer of the problem it should solve or what kind of solution should be chosen.
People without computer science foundations often use AI by giving vague requests and then passively accepting the output. People with foundations can break problems down clearly, give constraints, specify a technical direction, check edge cases, find errors, and continue asking better follow-up questions. In other words, CS knowledge has not been made obsolete by AI; it has become the judgment needed to use AI well.
AI has indeed changed the role of programmers. In the past, much programming training focused on fluency with syntax, writing templates by hand, memorizing APIs, and quickly implementing common functions. These abilities will become less important, because AI can already produce many first drafts. But this does not mean previous training has completely failed. Rather, the focus of training needs to shift: from “writing all code from scratch by oneself” to “understanding problems, designing systems, verifying results, debugging errors, assessing risks, and maintaining complex projects.”
AI pushes the programmer community toward greater polarization. Those who understand less are more likely to find AI trustworthy and to follow it blindly, but they may not be able to produce effectively; they may only create superficial demos or half-finished products. For technically strong people with solid foundations, flexible minds, and full engagement, AI is a powerful aid. It helps them reduce inefficient time and devote more mental energy to creating value.
Therefore, the AI era has only changed the emphasis of computer science knowledge: it must become more professional and deeper, and it should avoid training only low-level repetitive labor. You still need programming, algorithms, systems, databases, networks, mathematics, and engineering ability. The value of this knowledge is no longer mainly reflected in “Can I handwrite a piece of code?” but in “Can I judge whether this code is correct, reliable, and suitable for a real system?”
Q21: Should I learn AI first, or traditional computer science first?
If your goal is to use AI tools during the learning process, you can start using them immediately while also learning computer science foundations. AI tools have a low entry barrier and produce visible effects quickly.
If your goal is to seriously understand or build AI systems, you should first learn, or learn in parallel, the foundations: programming, linear algebra, calculus, probability, statistics, algorithms, and enough systems knowledge to understand large-scale computation. If you skip these, you will soon hit a bottleneck.
For most AI learners, the best path is neither “traditional computer science first, AI later” nor “AI first, foundations later.” A better path is interleaved learning: study the mathematical and programming foundations, and then use small AI projects to make them concrete.
Q22: Can I use AI tools while learning? Will using AI heavily prevent me from mastering the material?
You can use AI tools, but you need to be careful.
AI does not necessarily prevent mastery. What truly weakens learning is letting AI directly complete the parts that most need to be trained before you have thought, tried, encountered errors, and revised.
Research generally points to a clear distinction: AI can improve task completion efficiency, but it does not necessarily improve conceptual understanding. In a 2025 CS1 programming-course study, students who used ChatGPT received higher code-quality scores and completed tasks faster, but their gains in conceptual understanding were mixed; the researchers also recommended structured AI integration combined with strategies for cultivating independent problem-solving. Another study of 298 introductory programming students found that students used ChatGPT in very different ways: some directly accepted generated answers, while others asked critical follow-up questions, modified answers, and verified them; the study also noted that generative AI can help introductory programming learners, but can also provide misleading information to novices. (Sources: https://arxiv.org/abs/2510.00946; https://arxiv.org/abs/2407.20792.)
More importantly, AI affects “things you already know” and “new things you are currently learning” differently. A 2026 randomized controlled experiment by Anthropic studied how developers learned an unfamiliar Python asynchronous library with AI assistance. The AI-assisted group scored 17% lower on the later mastery test, but the study also noted that not all AI use reduced learning: those who used AI to ask conceptual questions, request explanations, and analyze code retained learning better. This shows that the issue is not whether AI is used, but whether the learner still maintains active understanding. (Source: https://arxiv.org/abs/2601.20245.)
So when learning computer science, AI should be positioned as an explainer, sparring partner, checker, debugging assistant, and provider of a second explanation, not as someone who completes assignments for you. You can ask AI to explain error messages, generate smaller examples, check your code, point out edge cases, quiz you, and compare two solutions; but you should not ask it to give you the complete answer before you have tried.
A simple rule is: try first, then use AI. Read the problem first. Write your idea first. Write an initial version of the code first. Let the program produce errors first. Search for the error yourself once. Then ask AI: “Is my understanding correct?” “What does this error mean?” “Do not give me the answer directly; give me a hint about what I should check next.” Used this way, AI strengthens learning. By contrast, if you start by asking “write the complete code for me,” you may get something that runs, but you will not gain an ability that truly belongs to you.
Early learning especially needs a no-AI practice zone. Basic exercises—variables, loops, functions, recursion, arrays, linked lists, hash tables, simple algorithms, and small projects—should at least partly be completed without AI. These exercises are not training you merely to “produce code”; they are helping you form mental models: how a program runs step by step, how variables change, how functions are called, and how errors arise. If AI walks through all of these processes for you, you may seem to learn faster, but you may actually form ability more slowly.
Better ways to use AI include:
| Use | Recommended? | Reason |
|---|---|---|
| “Give me the complete answer.” | Not recommended | Easily bypasses the thinking process that needs training. |
| “Explain this error message, but do not change the code yet.” | Recommended | Trains error-understanding ability. |
| “Give me a smaller example.” | Recommended | Reduces difficulty without replacing thinking. |
| “Check where my code may be wrong.” | Recommended | Works well as a feedback tool. |
| “Give me three hints, but do not give the answer directly.” | Recommended | Preserves necessary difficulty. |
| “Explain step by step how this code runs.” | Recommended | Helps build a mental model. |
| “Help me finish this assignment.” | Not recommended | May produce a result, but weakens ability formation. |
| “Challenge my solution and its edge cases.” | Recommended | Trains technical judgment. |
中文
第一章 —— 与其感慨路难行,不如马上出发
起点
Q1:我能学会计算机科学吗?
可以,唯一的要求是你愿意把困惑看作工作的一部分,而不是把它看成自己不适合这门学科的证据。
你只需要一台普通的电脑、持续投入、以及一些好奇心。许多最好的课程、教材、工具、文档和论文都可以在网上找到,但资源数量太多了,如何找到最适合自己的那个,是一个麻烦(本指南试图在这一点帮助你);另外一个麻烦是,如何在不借助学校或老师的监督下,有规划的持续投入。
你不需要觉得自己有数学天赋,也不需要已经很懂计算机技术。你需要的是愿意一步步来,不跳过那些看起来很慢的步骤。
还有,这条路上有几个(或许)反常识的地方:名气、学位和职业背景与能力关系不大;学校远非最佳的学习地点;最好的老师永远是自己;学习是一种生活方式而非一次性的辛苦劳动。
Q2:我需要计算机科学学位吗?
不一定。学位在某些方面有用,但它不等于知识或能力本身。
学位提供资源入口、学习规划、学习同伴、能力评估和入行凭证。这些都是真实优势。纯粹的自学需要有意识地寻求替代品:学习计划、练习、项目、反馈,以及自测。
在某些公司、某些国家和多数研究生项目中,学历凭证很重要。若你的目标是理解这门学科、成为技术人员、获取专业能力,学位与此并不直接相关。
需要注意的是,世界上大部分人并没有直接进入顶级学府学习的资格,这可能是经济条件、地区限制等决定的;但人人都可以通过网络获得最好的学习条件;而触手可及的那些大学、编程速成班,可能提供的是质量一般的课程,同时带来几倍的困惑。
自学最困难的领域,是那些需要长期专家反馈的部分:高级理论、研究级工作、大型系统项目和学术写作。自学最有效的领域,是那些有优质公开课程、清晰练习和即时反馈的部分,因为程序要么运行,要么失败。
另外,还有一点必须指出,拥有计算机学位并不代表能成为从业者、或者被科技公司雇佣。原因是多方面的:
- 学位和成绩与实际工作能力并不完全挂钩,学校表现优秀的学生不一定是优秀的雇员、从业者;名牌大学的毕业证书能证明的东西很少。
- 学校培养的能力和实际生产环境中的能力有很大出入,学生需要锻炼自己的“个人实践能力”。
- 技术更新速度很快,学位无法一次性覆盖长期职业能力。 计算机领域的基础知识相对稳定,比如算法、操作系统、数据库、网络和编程语言原理;但具体工具、框架、平台、开发流程和产业需求变化很快。学校课程通常更适合打基础,不可能持续同步所有最新技术。
- AI 时代进一步提高了对判断力的要求。会使用 AI 工具已经越来越重要,但更重要的是能判断 AI 输出是否正确、是否安全、是否适合真实系统。没有扎实基础的人,可能更容易被 AI 的流畅答案误导。
- 从学生到从业者,中间还隔着实习、项目和作品集。学校成绩主要证明你能完成课程任务,但企业更关心你是否做过真实或接近真实的项目:能否把一个东西从想法做到可运行,能否处理 bug,能否维护代码,能否把功能交付出来。没有实习、项目、开源贡献或可展示作品时,即使有学位,也很难让雇主判断你是否具备实际工作能力。
- 招聘本身受市场环境影响,不完全由个人能力决定。科技公司是否招聘、招聘多少人、招聘什么岗位,会受到经济周期、公司预算、业务调整、裁员、组织变化和地区限制影响。即使一个人有计算机学位,也可能遇到岗位减少、竞争激烈、校招名额收缩、简历筛选严格等情况。因此,学位只能提高机会,不能保证被雇佣。
Q3:我需要什么背景知识?
学习计算机科学需要的背景知识并不算多。但为了彻底展示这些需求,不妨先假设有一个从未见过电脑、只接受过初等中学教育的人,在正式学习计算机之前,需要哪些知识:
- 熟悉电脑,通常可以用多“玩”电脑、多尝试不同的功能获得这些技能。不要害怕把电脑“玩坏”,电脑很难被新手彻底破坏。包括:
文件和文件夹的操作,什么是文件、文件夹、路径、扩展名软件的安装与卸载- 会用
浏览器搜索问题、查找官方文档 - 会使用
文本编辑器编辑文档、使用压缩软件解压和压缩 - 知道
编程工具、终端工具的功能和基础使用 - 熟练
打字。英文键盘、大小写、符号输入都很重要。编程里大量使用:() [] {} ; : 等符号
- 基础的英语读写能力,会查网络词典。大量工具、报错、文档、命令、函数名都用英文。只需要知道 2000 个左右的词汇,就可以顺利地学习编程,这大概是作为第二语言学习三年英语的水平——但英语水平决定了上限
- 初中水平的数学
- 四则运算、括号、负数、小数、分数、百分比
- 方程和函数
- 集合和关系,知道“属于”“包含”“交集”“并集”“映射”这些概念
- 基础的逻辑,理解“并且”“或者”“不是”“如果……那么……”
这些内容通常不会在大学中被教授,但经常会有新大学生缺少这些基础知识而感到挫败、想要放弃。一些知识可以通过 MIT 的课程 The Missing Semester of Your CS Education 获得,但这门课不是面对绝对意义上的初学者。
除此之外,还有一个最容易被忽视的基础:错误处理能力。许多初学者看到代码运行后出现一堆错误,马上就会感到强烈挫败,兴致全无。计算机学习的日常就是:写代码 → 报错 → 查错误 → 修改 → 再报错 → 再修改 → 成功运行。所以,在正式学习之前,必须先建立一个观念:报错不是失败,而是必要过程;程序或运行环境正在告诉你,哪里不符合规则。
对比大部分专业,这个入门门槛完全称得上“非常低”。仅靠这些,就能让你的计算机技能真正“活起来”,有实际产出。但英语和数学能力显著地决定了能力上限,是必须要持续投入、持续学习的学科。每一分投入都会在将来以某种形式回报你。
Q4:没有数学背景也能学计算机科学吗?
可以,但不能逃避数学。
你可以在只有一点数学基础时先开始编程。编程会给你信心、反馈和具体经验。但如果你想理解算法、人工智能、机器学习、密码学、图形学、形式化方法或理论计算机科学,数学会变成一切的地基。
实际顺序是:先学编程,或把编程和离散数学一起学;然后根据目标学习证明、线性代数、微积分、概率和统计。不要在写代码之前试图把所有数学一次吃完。也不要以为编程能力会自动替代数学能力。
Q5:认真学习计算机科学需要多久?
取决于目标。
要在编程上达到有生产力的水平:需要数月持续投入。要理解足够扎实的基础,能够在不同子领域之间移动:需要一到两年的认真学习。要在系统、AI、理论、安全、图形学或其他专门方向达到真正深度:需要数年的学习和实践。这对一门严肃学科来说很正常。
对自学者而言,现实节奏是一次学习一个主要主题,并且每个主题在学习材料之外,还要有产出:课后习题、小型练习项目、笔记、论文的总结。
对于刚从高中毕业的学生而言,我想澄清一件事:学习效率和时间限制再也不会是你的主要困难了。这很好理解,应试教育的唯一审核标准就是确定时间出现的那次考试的成绩。但学习计算机科学,和人生一样,都是一场“无限游戏”。
James P. Carse 在《有限与无限的游戏》一书中,把“无限游戏”定义为“没有最终结局,不是为了输赢成败,而是为了更好的继续游戏的那种游戏”。有限玩家希望把人生变成可结算的成绩;无限玩家希望把人生保持为开放的创造。你将面对的,是不会有尽头的探索,自由的创造;你可以选择你喜欢的任何形式而存在、而行动——不是被规定为一个在监督和审核下为了满足标准而行动的“客体”。
在学校这个有限游戏中,唯一重要的是尽可能完美地扮演“学生”这个角色。学校的规则是确定的、有限的、封闭的。但世界不是一场表演秀,这对于学习计算机的学生来说尤为明显:因为学习不仅仅赋予你知识,更有现实中的“力量”、“创造价值的能力”、乃至“权力”。清晰决策、创造价值、交换价值、理解世界,远比扮演好“学生”更贴近本质。
如何使用这份指南
Q6:这份指南是什么,适合谁?
这是一份关于计算机科学作为一门学科的结构化地图。它尽量涵盖所有计算机科学相关领域,并试图列出高质量资源。它适合几类读者:
- 几乎没有基础的初学者
- 想补齐知识缺口的自学程序员
- 想获得更深理解的在职工程师
- 需要基础支撑的 AI 学习者
- 来自相邻领域、希望认真理解计算的人
它只要求你愿意练习,愿意阅读困难材料,并且在后续主题变得难以理解时,愿意回到前置知识。这份指南不应该像小说一样从头读到尾。它是一张地图。 你用它来理解地形,选择路径,然后真正花时间进入资源和练习。
Q7:我需要按顺序阅读吗?
不需要,只需要注意每节开头列出的前置知识或前置课程。第二章是几乎所有内容的基础,之后路径会分化。
Q8:我该选择学什么?
几乎所有类型的读者都有一个相同的通用主干:
CS50x / Berkeley CS 61A —— MIT Missing Semester —— MIT 6.042J —— MIT 6.006 —— CSAPP
完成这些基础课程后,你应该可以独立写出小程序、调试错误、理解常见数据结构和算法、读懂基本数学符号,并对操作系统、网络、数据库和 AI 等分支有初步概念。下一步不应该盲目深入,而应根据目标选择路径。
- Web 前端开发:MDN Learn Web Development —— The Odin Project —— Full Stack Open —— You Don’t Know JS Yet —— PortSwigger Web Security Academy。
- 后端开发:Full Stack Open 后端部分 —— 数据库与 SQL —— 系统设计基础 —— API 设计与认证授权 —— CMU 15-445/645 —— MIT 6.5840。
- 全栈应用开发、软件工程师:The Odin Project —— Full Stack Open —— Software Engineering at Google —— Refactoring —— 开源项目阅读与维护 —— 测试 / CI / 代码审查实践 —— 一个完整产品项目。
- DevOps / 运维 / SRE:Linux / Shell 实践 —— 计算机网络 —— Docker —— Kubernetes Tutorials —— AWS / GCP / Azure 基础 —— Observability —— Google SRE Book / Workbook。
- 数据分析师:SQL —— Berkeley Data 8 —— 统计推断 —— 数据可视化 —— A/B 测试 —— 业务分析项目。
- 数据工程师:SQL —— 数据建模 —— 批处理 / 流处理 —— Airflow / dbt —— 云数据仓库 —— CMU 15-445/645 —— 分布式系统。
- AI 应用开发者:Python —— API / Web 基础 —— Hugging Face Course —— LLM 应用框架 —— RAG / Agent 项目 —— 部署与评估。
- 机器学习工程师:线性代数 —— 概率统计 —— Stanford CS229 / MIT 6.036 —— MIT 6.S191 —— Full Stack Deep Learning —— MLOps Zoomcamp。
- LLM / NLP 工程师:Stanford CS229 —— MIT 6.S191 —— Stanford CS224N —— Hugging Face LLM Course —— Stanford CS336 —— LLM 论文复现。
- 计算机视觉工程师:线性代数 —— Stanford CS229 —— MIT 6.S191 —— Stanford CS231n —— 视觉项目 —— 部署与优化。
- 数据库 / 存储系统工程师:CMU 15-445/645 —— SQLite / PostgreSQL 源码阅读 —— 分布式系统 —— 存储引擎项目 —— 事务 / 日志 / 复制。
- 系统程序员 / 操作系统方向:C / Rust —— Nand2Tetris —— CS:APP 深入 —— MIT 6.1810 —— 编译器 / 网络 / 分布式系统选修。
- 嵌入式 / 底层开发:C —— 计算机组成 —— 操作系统基础 —— 微控制器项目 —— RTOS —— 通信协议。
- 网络编程 / 网络系统:计算机网络 —— Socket 编程 —— 协议实现项目 —— 网络性能分析 —— 分布式系统 —— SRE 实践。
- 网络安全:Web 安全基础 —— PortSwigger Web Security Academy —— 系统基础 —— pwn.college —— MIT 6.858 —— Cryptography I。
- Android 移动开发:Android Basics with Compose —— Android 官方 Training —— Kotlin —— 网络 / 数据存储 —— 架构与测试 —— 完整 App 项目。
- iOS 移动开发:Develop in Swift —— Stanford CS193p —— SwiftUI —— 网络 / 数据存储 —— 架构与测试 —— 完整 App 项目。
- 游戏开发:Unity / Unreal 二选一 —— Game Programming Patterns —— 线性代数 —— 物理 / 动画 / 输入系统 —— LearnOpenGL —— 小型游戏项目。
- 计算机图形学:线性代数 —— LearnOpenGL —— 图形学教材 —— 渲染器项目 —— GPU / Shader —— 基于物理的渲染。
- 机器人 / 自动驾驶基础方向:线性代数 —— 概率 —— Modern Robotics —— 控制 —— 状态估计 —— 路径规划 —— 视觉感知。
- 编程语言 / 编译器方向:函数式编程 —— PLAI —— Nand2Tetris Part II —— 编译器课程 —— 类型系统 —— 程序语义。
计算机科学是什么
Q9:计算机科学都包含哪些内容?
计算机科学以编程、算法以及必要的数学为基础。在此之后,可以总结为四个方向:计算、系统、智能、应用。
- 计算。什么可以被计算?用什么方式计算?计算需要多少资源?计算有没有边界?它包括可计算性、复杂性理论、形式语言、自动机、算法分析、逻辑、类型论、程序语言理论、语义学、形式化方法等内容。这里是数学与计算机科学结合最深的区域。算法、密码学、编程语言理论、形式验证等方向都强烈依赖这个方向。
- 系统。如何构造、理解和运行由大量相互作用的部件组成的复杂系统?它包括计算机体系结构、操作系统、网络、数据库系统、分布式系统、并发编程、编译器、容器编排、可观测性、嵌入式系统、高性能计算等内容。这个方向的难点通常不在单个概念,而在许多部件同时运行、共享资源、发生故障、互相影响时,如何仍然保持可理解、可控制、可维护。
- 智能。计算能否产生智能?如果能,它通过什么机制产生,又有什么限制?它包括人工智能、机器学习、深度学习、大语言模型、自然语言处理、计算机视觉、强化学习、机器人、知识表示、自动推理、可解释性、AI 安全与对齐等内容。它也是计算机科学最直接连接认知科学、哲学、语言学、神经科学的区域。
- 应用。这不是“低级”或“只是写业务代码”,而是以上技能在具体场景中的组合。Web 开发、移动开发、游戏开发、图形学、网络安全、密码学、机器人、科学计算、人机交互、DevOps、SRE、数据分析、数据工程、AI 应用开发、数据库工程、系统编程、嵌入式开发等,都是不同方向的组合。例如,机器学习主要结合智能方向和计算方向,依赖数据;数据库结合系统方向和部分计算方向;网络安全结合系统方向、计算方向和工程实践;AI 基础设施则几乎同时涉及所有方向。
关于数据的研究的重要性正在随着人工智能的发展不断上升,现代 AI 很大程度上依赖数据的规模、质量、结构和处理方式;数据库、数据工程、信息检索、数据清洗、数据标注、数据治理、表征学习等内容,也因此变得越来越重要。不过从学习计算机科学的角度看,数据更像是贯穿多个方向的核心对象。
本指南正是按照这个模糊但有效的分类组织的。
Q10:编程和计算机科学是什么关系?
编程是学习计算机科学最基础、最常用的工具。很多计算机科学知识,最后都要通过写程序来验证、实现和使用;但编程不是全部,还要进一步学习:哪些事情电脑能做,怎样做更快、更可靠,数据怎样保存和传输,程序怎样在电脑和网络中运行,以及机器能不能表现出某种智能。所以,学习计算机科学通常要从编程开始,但不能停留在“会写代码”。
Q11:计算机科学和软件工程有什么区别?
计算机科学更关心原理:计算是什么,程序为什么能运行,算法为什么有效,系统为什么会出错,数据怎样被组织。软件工程更关心实践:怎样在真实项目中和别人合作,把软件稳定地做出来、改下去、维护好。二者关系很近,并且有大量交叉内容。
Q12:计算机科学的知识保质期有多久?
计算机科学里最耐久的是基础知识,比如抽象、递归、算法效率、数据结构、概率、操作系统、数据库和网络原理。这些知识不会因为某个框架或工具过时就失去价值。
工具、框架、平台和热门技术变化很快。今天流行的工具,几年后可能就不再流行。但如果基础扎实,换工具只是重新熟悉用法;如果只有工具经验,一旦工具变化,就很容易失去方向。
Q13:掌握计算机科学后,我实际能做什么?
掌握计算机科学后,你可以写程序、做网站、开发应用、分析数据、构建 AI 系统、理解网络和电脑系统,也可以把重复劳动自动化。更重要的是,你能把想法变成现实,理解技术背后的原理,而不是只会使用别人做好的工具。
为什么学习计算机科学令人感觉很难
Q14:学习计算机科学真的很难吗?
我上面已经提及了学习计算机科学有可能遇到的“困难”,在此重新列举:
- 没有接触到最好的学习资料
- 基础计算机技能的缺失被低估
- 学习顺序错误、跳课,导致没有理解进一步概念所需要的前置知识
- 把“报错”当成“不适合学习”的证据,而非正常的工作内容,因而感到挫败
- 从应试学习切换到开放式学习的不适应
- 不重视实际产出和动手能力,只学理论、课程
- 没有持续投入时间和精力
- 效率焦虑、自我设限等个人心理因素
所有这些“困难”都在暗示,计算机科学不是一个困难的学科;或者说,真正的难点不在计算机科学这一学科之内,并且绝大多数拥有强大专业能力的人都同意这一点。
Q15:学习计算机科学实际感觉像什么?
学习计算机科学有点像拼乐高。
一开始,你面对的是一堆分散的零件。每个零件看起来都不算太难。从这些零件的模样,丝毫推测不出来最终成品是什么样子。很多时候,你只是照着说明一步步做,但你不知道它们为什么要这样放在一起,也不知道自己最后到底能拼出什么。
犯错是常态,多尝试是解决方案。少了一块、放错一块、方向反了,整个结构都会卡住。学习计算机科学也是这样:一个小错误就可能让程序无法运行,一个没理解透的概念就会让后面的内容突然变得很乱。
它的快乐是延迟的:反复尝试之后,在你也没预料到的某一刻,那些零散的东西突然连起来了。你开始看见结构,开始知道为什么这里必须这样,那里不能那样。慢慢地,拼乐高从凭借耐心、跟着教程做,变成了能自己控制、自己组合、随心所欲的创造性游戏。
所以,学习计算机科学的感觉不是一直顺利地往前走,而是长时间的混乱、卡住、重试,换来某些突然清楚的瞬间。
Q16:怎样才能记住所学内容?
计算机科学的基础知识很多、种类驳杂。并且,学习的最终目的是解决问题,而不是闭卷考试。所以,比起用脑子死记硬背,应该采取更明智的策略:
- 建立个人笔记系统。把概念、命令、代码片段、错误记录、项目经验、资源链接和自己的理解整理起来。笔记不是为了抄教程,而是为了保存自己的思考:这个概念解决什么问题,容易和什么混淆,我曾经在哪里卡住,最后是怎样理解的。好的笔记会随着学习不断更新,而不是写完就封存。
- 编写实现。计算机科学的很多知识,只有在亲手写出来时才会真正变清楚。学栈,就写一个栈;学哈希表,就写一个简化哈希表;学解释器,就写一个极小的表达式解释器;学网络,就写一个简单服务器。build-your-own-x 这类资源的价值就在这里:通过从零重建数据库、Git、Docker、解释器、搜索引擎等工具,把平时只会使用的东西拆开理解。
- 定期复习,但不要只重读原文。重读会制造熟悉感,但不一定带来掌握。更好的方式是隔一段时间后,合上资料,尝试重新解释概念、重新写核心代码、重新做一道类似题。间隔重复(spaced repetition)和主动回忆(retrieval practice)都被广泛用于提高长期记忆。
- 记录错误。计算机学习中,错误不是垃圾信息,而是最有价值的学习材料之一。一次路径错误、一次类型错误、一次环境配置失败、一次递归写错,都说明你的模型和真实机制之间有差距。
- 阅读代码、文档和优秀项目。只写自己的小程序,很容易停留在玩具水平;读别人写的真实代码,才能看到成熟程序如何组织结构、命名、处理错误、拆分模块、写测试。
- 接受长期反复,而不是一次学完。计算机科学不是学一遍就结束的知识。
Q17:应该如何练习?
编写实现。
Q18:我怎么知道自己是否理解了某个东西?
能正确编写实现。
Q19:针对计算机科学的常见刻板偏见、误解有哪些?
❌ 学计算机科学的人都会修电脑:学习者通常会在实践中“自行解决”某些软件和操作系统的问题,但不会系统性地学习如何维修电子产品。
❌ 上大学前不是“编程大神”,上大学再学就晚了:这个说法通常来自于某些大学新生对“竞赛大神”的“盲目崇拜”,以为“学的早”就是“学得好”;并给自己不去尝试找借口,安慰自己在学习阶段遇到的挫败。并且由于“自证预言效应”(一开始认为自己做不到,就不去尝试和投入,最后真没做到,就觉得一开始是对的),这个说法偶尔会应验。真实情况是“闻道有先后,术业有专攻”,有了正确的学习路径、多尝试、多行动,谁都可以成为“编程大神”。
❌ 名校毕业生通常是技术大神:这个说法把学校筛选能力和真实技术能力混为一谈。真实情况是,能力和个人关系较大,通常不能靠标签、名气来确定。
❌ 程序员都是孤僻、宅、只和电脑打交道的人 这个偏见来自计算机工作确实需要长时间专注,但它忽略了软件开发本身是高度社会化的协作活动。 真实情况是,程序员不仅要写代码,还要理解需求、解释设计、参与讨论、接受代码审查、写文档、和别人共同维护系统。
❌ 打字速度越快说明水平越高:优秀程序员的大量时间花在理解问题、设计结构、阅读代码、调试错误上,真正决定水平的不是敲得快,而是想得清楚。
❌ 优秀程序员靠记忆语法和 API:这个说法是由于嘲笑“复制粘贴型程序员”而幻想出来的反面。“解决问题”才是真正的工作内容,记不住语法和 API 很正常。
❌ 黑客就是电脑屏幕上一直不停地过字母:这是电影电视剧中的表演方式。真实情况是,安全研究更多是在理解系统、寻找漏洞、验证假设、阅读代码、分析协议和写工具,不是看屏幕乱闪。
❌ AI 出现后,学习编程和计算机科学就没必要了 这个说法把“AI 能生成代码”误认为“人不需要理解代码”。真实情况是,AI 让写初稿更容易,但判断对不对、安不安全、能不能维护、适不适合真实场景,仍然需要计算机科学基础。
❌ 第一个语言必须学 Python:Python 确实适合多数初学者,因为语法简单、资源丰富、应用广,但第一门语言也可以是 JavaScript、Scheme、Java、C 或其他语言,关键是课程质量、练习强度和你是否真正理解变量、函数、控制流、数据结构这些基础概念。
❌ C 语言很底层,所以所有人都必须先学 C:这个说法把某一种有效路径当成了唯一入口。C 很适合理解内存、指针和系统,但初学者也可以先用 Python、Scheme 或 JavaScript 建立编程思维,再回头学底层。
❌ 不会数学就不能开始学计算机科学:这个说法把“深入需要数学”误解成“入门必须先学完数学”。真实情况是,你可以先学编程获得反馈和信心,但如果以后要深入算法、AI、密码学、图形学和理论,就必须逐步补数学。
❌ 做出一个网页或 App,就说明已经懂计算机科学了:这个说法把“能做出东西”误认为“理解了底层原理”。 真实情况是,项目很重要,但如果不了解算法、数据库、网络、系统和安全,作品能跑不代表你已经真正理解它。
❌ 复制网上代码能跑,就等于解决了问题:复制代码只能解决眼前问题,只有你能解释它为什么能跑、哪里可能出错、如何修改,才算真正拥有这段代码。
计算机科学与 AI
Q20:既然 AI 已经这么强,学习计算机科学还值得吗?
值得。AI 改变了计算机科学知识的价值,但没有消除它。
AI 工具可以生成代码、解释、测试、总结和原型。这让浅层代码生产不再那么稀缺,让判断力变得更重要:知道应该构建什么,生成方案是否正确,它依赖哪些假设,它如何失败,如何测试它,它如何影响用户,以及它如何放入更大的系统。
学习计算机科学,解决的是很多基础问题:计算机是什么,程序为什么能运行,算法为什么有快慢,系统为什么会出错,数据为什么要这样组织,AI 为什么能工作、又为什么会失败。AI 可以帮你写代码、解释概念、生成方案,但如果你完全没有底层知识,就很难判断它的回答是否正确,也不知道该让它解决哪一层问题、选用怎样的方案。
没有计算机科学基础的人使用 AI,常常只能提出很模糊的要求,然后被动接受输出;有基础的人则能把问题拆清楚,给出约束,指定技术路线,检查边界情况,发现错误,并继续追问。换句话说,CS 知识不是被 AI 淘汰了,而是变成了使用 AI 的判断力。
AI 确实改变了程序员的定位。过去训练程序员时,很多重点放在语法熟练、手写模板、记忆 API、快速实现常见功能上;这些能力的重要性会下降,因为 AI 已经能完成很多初稿工作。但这不代表原来的训练完全失效,而是训练重点需要调整:从“自己从零写出所有代码”,转向“理解问题、设计系统、验证结果、调试错误、评估风险、维护复杂项目”。
AI 使程序员群体两极分化——理解的越少的人,越觉得 AI 可信,越容易盲目地追捧 AI,但这些人并不能真正地有效产出,只能做出一些徒具其表的 Demo 或者半成品;AI 是那些有坚实的技术基础、灵活的头脑、全情投入的技术高手的强大助力,AI 帮助他们减少低效时间,用更多的心智去创造价值。
所以,AI 时代只是改变了计算机知识的侧重点——更专业、更深入,避免只训练低层重复劳动。你仍然需要编程、算法、系统、数据库、网络、数学和工程能力;只是这些知识的价值不再主要体现在“我能不能手写一段代码”,而是体现在“我能不能判断这段代码是否正确、是否可靠、是否适合真实系统”。
Q21:我应该先学 AI,还是先学传统计算机科学?
如果你的目标是在学习过程中使用 AI 工具,则可以立刻开始使用,同时学习计算机科学基础。AI 工具的门槛很低,但效果立竿见影。
如果你的目标是认真理解或构建 AI 系统,就要先学或同步学习基础:编程、线性代数、微积分、概率、统计、算法,以及足以理解大规模计算的系统知识。跳过这些内容,很快会遇到瓶颈。
对多数 AI 学习者而言,最好的路径既不是“先传统计算机科学,后 AI”,也不是“先 AI,后基础”。更好的路径是交错学习:学习数学和编程基础,然后用小型 AI 项目让它们具体化。
Q22:学习时可以用 AI 工具吗?大量使用 AI 是否会妨碍掌握知识?
可以用 AI 工具,但需要谨慎。
AI 不一定会妨碍掌握知识;真正削弱学习的是:在还没有思考、尝试、报错、修改之前,就让 AI 直接完成最需要训练的部分。
研究大体指向一个很清楚的区别:AI 可以提高完成任务的效率,但不一定提高概念理解。 在一项 2025 年的 CS1 编程课程研究中,使用 ChatGPT 的学生代码质量评分更高、完成任务更快,但概念理解的提升是混合的;研究者也明确建议,需要结构化使用 AI,并配合培养独立解决问题的教学策略。另一项针对 298 名入门编程学生的研究发现,学生使用 ChatGPT 的方式差异很大:有人直接接受生成答案,有人会批判性地追问、修改和验证;研究也指出,生成式 AI 对入门编程有帮助,但也会给新手提供误导性信息。(来源:https://arxiv.org/abs/2510.00946;https://arxiv.org/abs/2407.20792。)
更关键的是,AI 对“已经会的东西”和“正在学的新东西”影响不同。Anthropic 2026 年一项随机对照实验研究了开发者在学习一个不熟悉的 Python 异步库时使用 AI 的效果,结果发现 AI 组在后续掌握度测验中低了 17%;但研究也指出,并不是所有 AI 使用都会降低学习效果,那些把 AI 用来追问概念、要求解释、分析代码的人,学习效果保留得更好。这说明问题不在于“用不用 AI”,而在于你是否还保持主动理解。(来源:https://arxiv.org/abs/2601.20245。)
所以,在学习计算机科学时,AI 的正确定位应该是:解释器、陪练、检查者、调试助手、第二种讲法的提供者,而不是替你完成作业的人。你可以让 AI 解释报错、生成更小的例子、检查你写的代码、指出边界情况、给你出题、比较两种解法;但不应该在还没有尝试之前,就让它直接给出完整答案。
一个简单规则是:先自己做,再用 AI。 先读题,先写思路,先写一版代码,先让程序报错,先自己查一轮错误。然后再问 AI:“我这样理解对吗?”“这个报错说明什么?”“不要直接给答案,提示我下一步该检查哪里。”这样使用 AI,会强化学习。相反,如果一开始就问“帮我写完整代码”,你可能会得到一个能运行的结果,但没有得到真正属于自己的能力。
学习早期尤其需要保留一块无 AI 练习区。基础练习,比如变量、循环、函数、递归、数组、链表、哈希表、简单算法、小项目,最好至少有一部分完全不用 AI 完成。因为这些练习训练的不是“产出代码”,而是让你形成心智模型:程序怎样一步步运行,变量怎样变化,函数怎样调用,错误怎样产生。如果这些过程全部被 AI 替你走完,你会看起来学得更快,实际上可能更慢地形成能力。
比较好的 AI 使用方式是:
| 用法 | 是否推荐 | 原因 |
|---|---|---|
| “给我完整答案” | 不推荐 | 容易绕过真正需要训练的思考过程 |
| “解释这个报错,但先不要改代码” | 推荐 | 能训练错误理解能力 |
| “给我一个更小的例子” | 推荐 | 能降低难度,但不替代思考 |
| “检查我的代码哪里可能有问题” | 推荐 | 适合做反馈工具 |
| “给我三个提示,不要直接给答案” | 推荐 | 保留必要困难 |
| “解释这段代码每一步怎么运行” | 推荐 | 有助于建立心智模型 |
| “帮我写完这个作业” | 不推荐 | 可能得到结果,但削弱能力形成 |
| “请质疑我的解法和边界情况” | 推荐 | 训练技术判断力 |