Home  >  Article  >  Backend Development  >  What problems did the emergence of golang language solve?

What problems did the emergence of golang language solve?

silencement
silencementOriginal
2019-12-25 13:23:203468browse

What problems did the emergence of golang language solve?

Programming languages ​​as tools have the same purpose as all other tools, which is to improve productivity. Go language is no exception. Go language also has GC and supports Erlang-style lightweight concurrency. The most valuable thing about Go language is the improvement of existing OOP. Now, no matter what language supports OOP, it can There will definitely be a huge inheritance tree, but no matter how large or elaborate the tree is designed, it is still a static structure. Once it does not match the actual problem, a bunch of Adapters will have to be written. The Go language uses completely different methods.

There is no static inheritance or implementation relationship between classes. This relationship is not determined until it is used. For example, FileInputStream in java implements the InputStream interface,

This relationship must be determined when defining FileInputStream. When defining FileInputStream in Go language, you do not need to specify the interface it wants to implement. If the method

implemented in this class happens to satisfy InputStream, then you can It can be considered that the InputStream interface is implemented. This implementation means that the Go language no longer has the various troubles that traditional OOP has, while providing the same expression capabilities and being more elegant.

Recommended to study "

golang tutorial

"

There is no problem between Turing equivalent programming languages ​​that one language can solve but the other language cannot. It is better to say that one language solves a certain problem than another language. Go language is easier in object modeling due to its innovation in OOP. Concurrency lines similar to Erlang allow the development of high-concurrency network applications. The logic complexity can be greatly reduced.

Increased productivity is a benefit.

The above is the detailed content of What problems did the emergence of golang language solve?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn