This is a question I answered on Zhihu about which programming languages to learn.

Too long to look at the version

  • C language, structured programming, system programming

  • Java language, object-oriented programming, software design, Java community and engineering support

  • Python language, dynamic language, lightweight development, artificial intelligence

  • Lisp, functional programming, model building

  • Rust language, security programming, engineering practices of the summation

A detailed version

Why learn multiple programming languages? For the sake of the job itself, knowing a programming language or two will suffice. To learn more than one programming language is necessarily to expand themselves in a certain aspect, but what is to expand?

I devoted my geek Hour column, The Beauty of Software Design, to this topic. In short, we learn programming languages mainly in order to learn the programming models provided by different programming languages, such as different ways of organizing programs, different control structures and so on. Because different programming models give us different ways of thinking.

So, if you look at programming language learning from this point of view, the answer is obvious: pick the most classic programming language with different models. So what are the specific languages to learn?

The C language

The first is C.

On the one hand, from the perspective of programming paradigm, C language is a classical structured programming language, and learning C language also enables you to master the basic ideas of structured programming. C doesn’t just provide programming ideas. Its basic control structures, such as for and while, are the foundation of many programming languages, such as C++ or Java. Mastering C syntax is helpful for learning more programming languages in the future.

On the other hand, C is still the dominant language in system programming. In areas where computer power needs to be fully utilized, such as operating systems, graphics and image processing, C is still preferred.

Therefore, learning C language, grammar is the foundation, but also learn how to fully extract computer performance.

The Java language

Then there is the Java language.

In terms of programming paradigms, Java is a good example of how to learn object-oriented programming, and many books on object-oriented programming are written in Java. Compared to C++, learning Java can ignore many details that are not related to software design, such as memory management, and focus more on the software design itself. Learning Java without learning software design is like going through a treasure hill without getting in.

Not only the language itself, but also the Java community is a fascinating place to learn Java. The rise of the Java community has almost coincided with the growth of the open source community. Open source projects like Spring have even caused a paradigm shift in the entire Java community, turning the way development is done upside down.

Learning Java is also very important, that is, in the supporting project. The rise of the Java community coincided with the development of agile software development concepts. As a result, Java has also become a testbed for ideas: automated testing, refactoring, continuous integration, continuous delivery, and so on, so the Java community has tools to learn from.

The Python language

Then there’s Python.

C language and Java language are static language, no matter what start project, must pull open posture. Most of the time, we just want to do some simple projects, do not want to strain so much, so we have a light language, that is the value of dynamic language.

In order to make code easier to write, dynamic languages have a lot of syntax to simplify code writing, such as the literal representation of various data structures, type deduction, deconstruction, and so on. Languages like Java have started to learn these things, and continue to simplify code writing.

There was a lot of competition in the dynamic language circuit, with Python, Perl, Ruby, and so on. Perl has the advantage of being first, Ruby used to rely On Ruby On Rails to get a lot of attention, Python has been running at a snail’s pace. Finally, in the wave of artificial intelligence, Python burst out and completely left the competition behind.

Lisp dialect

The next thing you should learn is a dialect of Lisp, whether Clojure, Scheme, or Common Lisp.

The purpose of learning this language is to understand functional programming, which is an important programming paradigm and is becoming increasingly important. The immutability of functional programming and combinatorial programming influence the syntax and API design of various new programming languages.

Lisp is the oldest functional programming language. Its core model is extremely simple, then layered on top of the underlying model to build more complex models. At the heart of learning functional programming is learning this ability to build models. The construction and Interpretation of Computer Programs is an industry classic. At its core, it is about building models: from basic data models, to programming languages, to a machine with computational power. The programming language used in this book is Scheme, a dialect of Lisp.

Because of this powerful model-building ability, the Lisp community has come up with interesting solutions to various problems, such as software transactional memory to deal with concurrency. All of this is based on functional programming.

Rust language

With the above languages, you have basically covered the core programming paradigms and mainstream programming models. If you still have the spare time to learn the latest developments in programming languages in the industry, I recommend learning Rust.

Most people’s attention to Rust in the industry probably began with the attitude of some large companies, whether it is Amazon, Microsoft or Google, which face a lot of “security” problems. Rust’s design features address these issues effectively.

If you’re new to Rust, it can be a frustrating experience. Not surprisingly, Rust’s language design imposes many restrictions for “security” that are very uncomfortable for programmers who are used to letting themselves go. But one thing you should know is that Rust is the epitome of engineering practices. Once you have a foundation of good engineering practice, you will understand the value of Rust design. Such as:

  • Rust defaults to values, not variables, because immutability reduces the chance of errors

  • Rust has no constructors because a named factory method is a more appropriate approach than a constructor

  • Rust doesn’t have a null pointer, but instead has an Option so you don’t deal with the null case anyway

Rust is a programming language that is both painful and enjoyable for programmers, the pain of writing programs and the joy of running them. But we should recognize that programmers can be unreliable at times, and that most programmers can be unreliable at times, so having a programming language that limits them is actually a good thing.

Is this the end? Of course not. This is the starting point. With these programming languages as a foundation, learning other programming languages becomes much easier. Learn a new language every year, according to How To Become a Programmer.