Teaching yourself computer science can be a huge beast to tackle. You no longer have the enforced structure of Universities and you might not have the money to purchase online courses. The way to defeat these problems is to identify what there is to learn and choose the best possible medium to learn each subject. Computer science is a huge umbrella of topics and you must choose the ones that are most relevant to your future jobs.
These are the best books I've read for teaching myself computer science. By the best, I do not mean the easiest—most of these books present quite a challenge. The books listed in this article are comprehensive but not excessively complicated. These are not the only ones you should read to fully master each subject. They are, however, a great start. You may not agree with my picks and that's completely fine. These books blew my mind and have also helped every person I've recommended them to and I hope they can do the same for you.
Best for Algorithms: Introduction to Algorithms
There is no computer science without algorithms and the data structures they operate on. Everything that uses some form of computer utilizes efficient algorithms to maximize performance. Introduction to Algorithms (colloquially referred to as CLRS from the 4 authors' initials) is the best book I've ever read on the subject of algorithm design and analysis. Most university computer science curriculums include CLRS and this is due to the quality of the book. Though a rigorous and technical read, CLRS actually makes an otherwise dry combination of math and theory in computer science really enjoyable.
CLRS may look scary with all the mathematical analysis, it's actually a more beginner friendly book. Before waltzing into this book, you should already be familiar with mathematical concepts such as derivatives, integrals, discrete probability and formal logic. If you aren't already acquainted with these concepts, it will hopefully only take you a few weeks to really nail them down before reading CLRS if you're an efficient self-teacher. The fact that CLRS includes a lot of math is actually very helpful to convey exactly what the authors mean when explaining new concepts.
There is a high chance that this book or some course on Algorithms is all that separates you from getting to the next level as a programmer. Your critical thinking skills will be heightened and you will be equipped with the tools to design and analyze your own efficient algorithms which will have you prepared for a higher paying job as a programmer. Remember that knowledge in algorithms is what separates the engineers from the code monkeys.
Best for Computer Architecture: Computer Systems: A Programmer's Perspective
Learning the bits and bytes of computers can be very dry at times but the rewards for exerting the effort are astounding. Computer Systems: A Programmer's Perspective (or CS:APP for short) gives you a look under the hood of your computer and how to manipulate it close to the metal. You're given a quick run through of basic C programming, extensive exposure to x86_64 Assembly language, the design and implementation of an instruction set, and coverage of life in kernel-land. This book is the one that finally made Assembly make sense to me after a massive mental block had plagued me for months and taught me enough to make me marvel in what I managed to learn. Needless to say, I love this book.
Since my articles are usually geared to people interested in hacking, I believe this book will be the most interesting for you to absorb the information presented. You are frequently asked to reverse engineer code and there are also two labs that you might find especially interesting. The Bomb Lab and Attack Lab both put you in the shoes of an attacker who must reverse engineer binaries to defuse a bomb or exploit vulnerabilities, respectively. There are a few more labs, however I think the audience I target would take this as good motivation to read it.
Learning a good deal about Algorithms and Computer Architecture will help transform you into a highly effective programmer. If you were to only make the effort to read two of the books on this list, go with CLRS and CS:APP. Thank me later.
Best for Concurrency: The Art of Multiprocessor Programming
One of the biggest optimizations you could make to a program is to take advantage of concurrency, which is the use of more than one processor core for a program's execution. The Art of Processor Programming is the best book I've ever read on concurrency and many people I know seem to share my sentiment.
The book uses the Java programming language to illustrate concepts, so if you aren't already familiar with Java, I suggest learning over the next week. I know these concepts could easily be applied to any other programming language, but I find it the most convenient to just stay in the mindset of the book. Even though I dislike Java, the code snippets are clean, compact and free of confusion (at least to my standards).
You'll learn many essential topics in concurrency including: critical regions, threading, mutexes, spinlocks, scheduling, concurrent data structures and so much more. This book seems to cover everything you'll need as a general software developer and the advanced concepts you'll need to write performance-critical applications.
Best for Networking: Computer Networks
Networking holds the internet together. Needless to say, computer networking is tremendously important to our society so learning how it works is crucial to you as a programmer. This book's author, Andrew S. Tannenbaum, is seen as one of the most influencial computer scientists of all time, influencing even our loveably offensive Linus Torvalds—also notably feuding with him.
You'll learn about: packets, transmission, routing algorithms, network protocols and so much more that work to hold this world together and connect us. Whether you plan on creating a chat client or a multiplayer game, knowledge of this domain will make your applications so much more useful.
Best for The Theory of Computation: Introduction to the Theory of Computation
The theory of computation is the branch of computer science that deals with how efficiently problems can be solved on a model of computation using an algorithm. The theory of computation is divided into three major branches: automata and languages, computability theory, and complexity theory. All of these branches are linked by the question of the fundamental capabilities and limitations of a computer; what a computer can and cannot do.
Knowledge of this subject allows computer scientists to understand how a machine, called an automata, solves problems or even if a problem can be solved at all. A lot of the information in this subject lays the groundwork for further exploration of computation in an Artificial Intelligence course.
Best for Compilers: The Dragon Book
You might not want to learn about compilers and that's understandable. Knowing how the conversion from text to machine code works is an incredibly powerful skill to have, if you choose to learn about it. Inventing your own programming language becomes an option all of a sudden if you put in the time to learn about compilers. I can recommend no other but the infamous Dragon Book for all of your compiler needs.
Compilers: Principles, Techniques, and Tools—known for the dragon on the cover—is probably the most comprehensive book on compiler design in existence and has aged remarkably well despite the latest edition being released in 2006. The Dragon Book is infamous because of its rigour and level of entry; the Dragon Book is not for beginners, do not be fooled by the cute cover art. The benefit of this book is that it teaches most of what you'll need to understand compilers all in one place.
Best for Operating Systems: Modern Operating Systems
As a high-level programmer such as a web-developer or Python-scripter, you are not exposed to interfacing with your operating system directly. However, there is the need to understand low-level concepts in programs that are performance-critical or even in development the low-level services themselves. Modern Operating Systems by Andrew S. Tannenbaum teaches you the information necessary to understand operating systems or even create your own.
If you are ever interested in creating your own operating system; this is the book for you. In fact, Linus Torvalds read an earlier version of this very book and soon after wrote the first version of Linux.
Best for Functional Programming: Thinking Functionally with Haskell
Functional programming seems scary to a lot of people because it's different to the way we usually program. You don't need a math degree to understand functional programming, though it does implement a more mathematically pure paradigm of programming. Functional programming is built on the central concept that function takes in inputs and produces outputs and does nothing more, with no mutable state. One set of inputs will always produce the same set of outputs just like how functions in mathematics are relations between a set of inputs and a set of outputs.
The Stack Overflow Developer Survey of 2019 listed Clojure, a functional programming language, as the highest paying programming language globally at $90000 annually. If you really want to make a lot of money programming, functional programming languages can offer that.
Best for Artificial Intelligence: Artificial Intelligence: A Modern Approach
Artificial Intelligence has been progressing rapidly for the last 60 years. Sub-branches of AI such as Machine Learning have been highly commercialized and could provide you with a very lucrative career. Artificial Intelligence: A Modern Approach by Stuart Russell and Peter Norvig is one of the best books on the subject of broader AI and is used in many prestigious universities.
The subjects you'll learn by reading this book include: agents, knowledge representation, machine learning, communication, computer perception and the philosophy behind artificial intelligence. This was the first book I ever read when trying to learn about AI and it has served me better than any other book which attempts to cover the same subject matter.
Best for Computer Graphics: Computer Graphics: Principles and Practice
Implementing impressive computer graphics has been made faster and easier through the use of game engines and modern 3D modelling software. When you're taking a course on computer graphics, you don't have the joy of abstractions that these game engines offer you. If you're uncomfortable with math, it's time for some exposure therapy—there is no way around it when talking theory.
Computer Graphics: Principles and Practice is an incredible resource on computer graphics, taking a mathematical approach similiar to that of CLRS. Topics such as: 2D and 3D space, ray-casting, rasterization, image representation, meshes, colors, shapes, textures and many more are taught with clarity in this book. Though very theoretical, this book also shows the practical applications for these concepts with the hopes of giving you the understanding necessary to create visually impressive and resource-efficicent computer graphics for your applications or even content creation.
There you have it, my top 10 essential books for teaching yourself computer science. Teaching yourself can be a challenge at times since there is no enforced structure like in Universities. You should check out my previous article for information on a self-taught curriculum. The door is open like never before and now is the best time to start learning for a good-paying job. I wish you safe travels and happy hacking!