Golang Use Feeling

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Golang Use Feeling

It's a language that makes a big difference to you. Four things: Performance, number of rows, ease of understanding, depth of pit (including relevant information on the Web and third-party libraries).

Performance aspects
Go's performance basically only loses the C family, the worst case also is slow several times (does not resemble some popular language to be multiplied), even if uses to realize the performance to be demanding the algorithm also is not wasted CPU. But if you look at the generalized performance, it is still relatively cool to count the concurrency. Like Ruby/python, the GIL-bound language is not spoken, and the speed advantage is obvious compared to the language of the direct OS-level thread/process. Of course, many languages can also package a lightweight thread implementation, but the problem is here, they do not do this thing, the need to use a third-party library will bring a lot of trouble.

Number of rows
This is the small disadvantage of Go, the overall performance is inferior to Ruby/python/scala/various FP. One of the dwarfish burst nine days off, egg chrysanthemum burning is: It has no generics, so that a simplest array of reverse are to be implemented for each type once. Some may say, with interface{} or reflect or something, but the stability of the program will go to the road. But in any case, it is shorter than the C-Family Code, if you can flexibly use closures, defer, can save a lot of things. In addition, if the concurrency logic is more complex scenes, the Chan, select with good, the code can be shorter than any language.

Ease of understanding
The difference from most languages is not obvious. But I've been reading some C-Family Code lately, and I've been feeling a little used to it. I found that a large part of the C family's code was wasted on the language itself, and Java was nowhere to go. So Go still should be upper-middle level.

Keng
At present, the Division I encountered in the use of all the pits on the internet is relatively easy to find a solution. Official documents are complete, the source code is also streamlined and understandable. Third-party things are not much, but the quality is much better than the third-party libraries like Nodejs. One thing to note is that we do not have a special test staff, but Go implementation of the service bug is very few, basically bug is the business understanding of the problem (or lazy) caused by, and the impact of the bug after the service can be controlled in a range, this is a good thing. Does not appear as before the C family when the pointer is flying, the memory of the chaotic situation, there is no Python colleague often appear variable name typo problem (you have seen a few people love using static Check tool?). In other words, Go's program is robust to the Java family.

The impression is more profound on these. For me, if Go has a generic complement, it's perfect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.