Author: Ru Jie

Link: https://www.zhihu.com/question/300163211/answer/654447355

Source: Zhihu

Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please indicate the source.

Say oneself get idea ha! Although I have been using GO for a long time, I do not agree with blindly speaking GO well. It is the right choice to clearly understand the advantages and disadvantages of each programming language.

Although Go is currently the language of choice for many project refactorings, there are still some disadvantages to use. Of course because Go is a young language, it is still developing and has a lot of room for improvement in the future. And the Go language team updates the version almost every six months, so I can feel that the Go team is gradually revising some of the shortcomings of the Go language.

  1. The lack of framework

GoLang developers have no significant framework. But there are other languages. Ruby has Ruby on Rails, Python has Django, and PHP has Laravel

2. Error handling

If an error is possible, the Go program needs a function to return an error. This can lead to problems with lost error tracing and a lack of useful error handling logic. There are tools that can help detect this error, but they are more like solutions. Developers also need to write a lot of if blocks to check for errors and handle them, which makes the code less clean. Of course, in the GO2 draft, it is said that the error handling mechanism of the Go language has been changed

3. Package management

Package management in Go is not perfect. By default, it cannot create a dependency tree with fixed package versions, which means that the generation created may be based on different versions of packages when built at different times. In contrast, Python, NodeJS (NPM), and Ruby all have relatively well-maintained package management systems. For example, in Ruby on Rails projects, you can have a Gemfile file that defines dependencies and their dependent versions, which means that even if some version of some version will be updated later in the future, the same version of the software package will be used to create the new version.

Finally, Go is a great choice when you’re working on a new project or planning to improve your next one. Once you get used to Golang development, you can make it mainstream because the advantages are so much greater than the disadvantages.

It helps you build complex applications on timelines and budgets, and can easily handle 1000 concurrent requests per second, which might be very difficult in other languages.