The Road Less Chose
Many similar questions come from Quora like this:
“How I can learn X in Y months”.
X is some specific fresh technology.
Everyone wants to learn quickly, but the truth is, everything worthwhile need hard working and enough time, no shortcut.
As for programming, getting the fun of programming is most important at the beginning, then confidence should be built for further learning. Ultimately, the core knowledge of computer science will be indispensable for your career in a long time.
Technologies come and faded, but the principle tends to remain more constant.
For those who want to be a good programmer, the narrow way is a better and longer one. So read the best and classic computer science books.
Plenty of learning resources about CS around the Internet, textbooks, video lectures, etc. The website teachyourselfcs.com had covered most of them. I have some different choices here, prefer the style of learn by doing and learning with fun textbooks(with some great open-source projects), it’s more enjoyable for me.
I will update this booklist regularly. If you have better choices, please tell me in the comments.
For the general programming category, the most important is showing the readers the ultimate basic concepts of CS or engineering, the beauty, and the joy of programming.
Good general programming books don’t just tell you how, but explain the why behind it.
General good programming style and practice are not related to specific programming language or technology.
These will help you how to think, it will help you become a better programmer.
This book talking about the best practices and major pitfalls of many different aspects of software development. It gives advice about meta-programming, little languages, testing, plain text interfaces, and many other aspects of development.
There are many similar advises for most problems and scenarios, investing in the long term and don’t repeat yourself. If you find something will be repeated, automatize it. If you find some tools you need to master, learn the most multi-faceted one so that you don’t need to repeat learning.
For example, one piece of advice is to choose an editor and use it adeptly, it’s true. For me, I have used Emacs for almost 10 years, there is no new learning curve when starting to learn new programming.
It’s like a new programmer’s bible. The first version is printed almost 25 years ago, but it still worth reading for developers. This book covers a wide range of issues in software construction that are relevant today, it’s well written and organized.
It even uses one chapter to teach you how to choose names for variables, methods, classes. Coding isn’t just about solving the problems. We’re writing something that others will read. That’s the essence of why naming is important when you write code.
If you consider programming to be a subset of writing, and I certainly do …
— David Heinemeier Hansson
Code Complete covers other parts like debugging, testing, error handling, design. These are the common parts for most programming languages and systems, they won’t dry at times.
SICP will show you the beauty of code, how to build a small language, how to build a good abstraction model, what is recursion, concurrency, stream, and abstraction. This book will teach you the techniques used to control the intellectual complexity of large software systems.
Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.
– Alan Perlis
It will change your perspective on programming, change your think about computing, it helps you to get a solid understanding of the fundamentals of computer science.
This is a challenging book, some well-skilled programmer also spends almost one year to finish it, including the exercises. Believe me, it worth your time.
There is also an online version.
Only 10% of programmers can write a binary search, is it surprised you?
It’s true many programmers don’t have enough knowledge and understanding of algorithms, most programmers will have some practice for the interview and then drop most after getting a job. But algorithms are indispensable for solving problems.
There are many textbooks for data structures and algorithms, but these are my favorites:
This book is easy to read, it contains many little stories. It will bring programming back in the ’80s when the computer’s memory and the disk are limited in small size, ancient programmers need to write code clever without so many modern tools. Solving problem mean think correctly, find the right algorithm and data structures. Programming as a craft. This book will show you the process and fun of designing algorithms.
Beginner: The series of Robert Sedgewick is a good choice, which with the sample code of C/Java.
Advanced: The Art of Computer Programming, they are hard to read, it’s better to use it as reference books:)
If somebody is so brash that they think they know everything, Knuth will help them understand that the world is deep and complicated.
– Bill Gates
Programming languages and compiler
Almost every programmer will learn several languages for daily work, but very few programmers will actually hands-on compiler development.
As an aspiring programmer, you should at least understand the overall procedures of compilers. Generally know how parser, AST analysis, code generation, and linker work together. Compiler technology contains many classic aspects of computer science, it’s worth your time even you do not need to write a compiler.
For the programming language category, we should learn the core concepts of languages, including semantics, computation models, and program elements. This is a basis for understanding future developments in programming languages.
If we have a solid understanding of language elements, working with a new programming language will be very easy.
This book actually is very fun, we build an interpreter for a small language with several lines of code! Then we extend it with abstraction technology: data types, functions, continuation, type and type checker, type inference, module, OOP, etc.
This book brings you face-to-face with the most fundamental idea in computer programming: The interpreter for a computer language is just another program. – Hal Abelson
Playing with interpreters skipped the most parts of parsing, and also didn’t deal much with code generation part. But it’s enough for learning the core concepts of programming languages.
EOPL is not an easy book, if you can not follow it then Programming Language Pragmatics is an alternative, not so many exercises for practicing, it still gives you a whole picture for language studying.
There are some other classic textbooks such as “the Dragon Book”: Compilers: Principles, Techniques & Tools.
If you prefer to learn functional compilers, these books are the best ones:
Lisp in Small Pieces: This book will describe semantics and the implementation of the whole Lisp family of languages, with full code supplied.
Compiling with Continuations: This book use continuation for compilation in a real compiler, the language is Standard ML. It covers all the details, including runtime and GC.
I recommend some great projects for self-learning, these projects are small enough, if you totally understand the code of them, you will get more interests on the subject of compiling techniques:
8cc: 8cc is a compiler for the C programming language. The compiler is able to compile itself. The code is clean and easy-to-read.
Build Your Own Lisp: Tell you how to build a Lisp interpreter in about 1000 lines C code.
tcc: Another C compiler that generates x86 code, larger than 8cc.
The classic book of Stevens, it teaches you the programming interfaces on Unix and covers almost everything you need to know to access the Unix/Linux OS. It’s good preparation for studying OS internals.
It’s well-organized, and also tell you the concepts of OS, explain the detail data structures and algorithms for implementation, especially explain the why of design. The key code is listed with comments too.
There are many small kernels for playing. Making a small kernel will cost much of time if you have enough interest and time, why not have a try, these links will help you:
OS dev.org including many good resources for references.
xv6: MIT xv6 is written according to the classic Lions code, the related course videos are very helpful.
How to Make a Computer Operating System: This tutorial gives you step-by-step instructions for building a toy OS.
For networking studying, there are many historical and theory parts, with all kinds of protocols, it may be very dry to some people.
But remember, you don’t need to remember all knowledge of every corner, the key point is to understand what the problem is solved by networking, why protocols are designed like that, how to you the related APIs of networking.
First, we need to have a big picture with the OSI model, understanding why it’s organized into seven layers, what is the data format in each layer. This book describing how the Internet works, how applications interact with each other through networking, explains the algorithms and protocols in detail, it also describes the history of networking.
Remember do the exercises with Wireshark or tcpdump.
Use the new version of these books, because TCP/IP is evolving all these years. These books help you understand more deeply on TCP/IP, Volume 2 contains a thorough explanation of how TCP/IP protocols are implemented, the key networking part of code (BSD 4.3 kernel). All these are very technical and not easy for everyone, but it is worth you to read.
Please practice with kinds of networking tools, try the labs in books will be very beneficial.
Do some projects with networking, for example, an HTTP server, make it handle multiple connections at the same time, make it perform better. Read a lot of code from some famous projects like Nginx, a good understanding of this kind of code requires to combine knowledge of operating system and networking.
Of course, you do not need to read all these books, but I believe finishing some will make you a better programmer.