Tell me why I don't like Go language Translated 100%

oschina Posted on January 14, 2019 15:28 (8 paragraphs in total, translation completed on January 24)
Reading 6522
Collection zero
top three
Loading

I use go language every day in my work. I am familiar with it, but I don't like go language, and I don't understand why it can be popular. Here are some explanations from several perspectives.

Developer Engineering

I have never seen a language that provokes such blatant hostility to developer engineering. For example, Rob Pike (the father of the go language) has repeatedly and publicly opposed any syntax highlighting on the go language platform, and his public answers to many good user questions are arrogant and rude.

Gofmt was written to reduce meaningless discussions about code formatting. I regret to say that no amount of meaningless discussion about syntax highlighting is useless, or I prefer to call it "spitzensparken blinkelichtzen" (used to ridicule users who enter wrong commands).

The above is from 2012 Go Nuts thread, in addition

Grammar highlighting is childish. When I was three years old, I didn't use a color stick to learn arithmetic( http://en.wikipedia.org/wiki/Cuisenaire_rods )。 Now I only use monochrome numerical symbols.

A
Translated at 21:44 on January 15, 2019
top
zero

The problem is that none of the people Rob cares about has experienced dyslexia, visual impairment or synaesthesia. Rob's disapproval of this idea makes Go's official website and document writing always emphasize freedom.

The Go team is different from Rob Pick, but they shared his views on ergonomics in other aspects union/sum In the discussion of type, the user lianlancetaylor directly rejected this request. He specifically pointed out an ergonomic benefit and thought it was too trivial to bother:

 

 This has been discussed several times in the past since before the open source release. The past consensus is that the sum type will not add too much content to the interface type. Once you have sorted them out, what will you get in the end? If there is an interface type, the compiler will check all the cases where you have filled in a type switch. This is a relatively small benefit for a new language change.

 

 Lesper
Translated at 09:48, January 19, 2019
top
one

This attitude is inconsistent with the view of union type in other languages. JWZ wrote when criticizing Java in 2000:

Similarly, I think the idioms available to simulate enumerations and keywords are pretty lame. (For example, the compiler cannot issue a lifesaving warning, "the enumeration value x 'is not processed in switch' '.)

The Java team has listened to the criticism in this regard, and now Java can provide switch  This warning is issued at enumeration Type. Other languages - including Rust, Scala, Elixir, friends and other modern languages, as well as Go's own direct ancestor, C - also give warnings when possible. Obviously, this warning is very useful, but for the Go team, the comfort level of developers is not important and is worth considering.

 Nil__
Translated at 17:38 on January 22, 2019
top
zero

Politics

No, not a mailing list or meeting type. A more in-depth and interesting type.

Like every language, go is a political tool. It embodies a specific set of beliefs about how software should be written and organized. In the case of Go, the language reflects the extremely strict hierarchy of "skilled programmers" and "unskilled programmers" enforced by the language itself.

For unskilled programmers, the language prohibits functions that are considered "too advanced". "Go" has no generics, and there is no way to write higher-order functions. These functions are generalized to more than one specific type, as well as extremely strict prescriptive rules about commas, unused symbols, and other immoral behaviors that may occur in general. code. This is the world where GO programmers live -- a more restrictive world than Java 1.4

 Nil__
Translated at 17:44 on January 22, 2019
top
zero

In terms of skilled programmers, programmers are trusted with these features, and can expose what they build to other programmers on both sides of the disagreement. The language implementation includes general functions, which cannot be implemented in go and meet the type relationship that cannot be expressed by the language. This is the world where Go practitioners live.

I can't say that Google is the origin of Google, but outside Google, this unanalyzed political position that classifies programmers as "trustworthy" and "untrustworthy" is the basis of many debates about language.

 Nil__
Translated at 17:49 on January 22, 2019
top
zero

Packaging and distribution of Go Code

go get It is a disappointing abdication of responsibility. The packaging boundary is the communication boundary, and the response of the Go team to "supplier everything" is equivalent to refusing to help developers communicate with each other about their code.

I can respect the position taken by the Go team, which is not their problem, but it makes them inconsistent with other major languages. Considering the disastrous history of C library package management attempts and the existence of Autotools as an example of how to make mistakes in a long enough time, it is very surprising to see the language teams in this century wash their hands.

 Nil__
Translated at 17:54 on January 22, 2019
top
zero

GOPATH


Using a single monolithic path for all sources makes version conflicts between dependencies almost inevitable. The vendor's solution partially solves this problem at the cost of a large number of repository bloat and extraordinary link changes. If the sold and non sold copies of the same library are linked in the same application, errors may be introduced.

Once again, the "not our problem" response of the Go team was disappointing and frustrating.

 Nil__
Translated at 17:55 on January 22, 2019
top
zero

Error handling in Go


The standard Go method for possible failed operations involves returning multiple values (not tuples; Go has no tuples), of which the last value is a type error, which is an interface, and its nil value means "no error occurred".

Because this is a convention, it is not representable in Go's type system. There is no general type to represent the result of an incorrect operation, on which you can write useful composite functions. In addition, it is not strictly followed: except for good meaning, nothing else will prevent programmers from returning errors in some other places, such as in the middle of the return value sequence, or at the beginning - so the code generation method for handling errors is also full of problems.

In Go, it is impossible to form wrong operations in any more concise way than some changes

     a, err := fallibleOperationA()     if err !=  nil {         return nil, err     }     b, err := fallibleOperationB(a)     if err !=  nil {         return nil, err     }     return b, nil

In other languages, this can be expressed differently as

     a = fallibleOperationA()     b = fallibleOperationB(a)     return b


In exceptional language, or as

   return fallibleOperationA()         .then(a => fallibleOperationB(a))         .result()


In languages with abstractions that can manipulate case values.

This has practical implications: code that performs long sequence error operations takes a lot of typing work to write (even if the editor supports generating branches), and requires a lot of cognitive effort to read. Style guides help, but mixing styles makes it worse. consider:

     a, err := fallibleOperationA()     if err !=  nil {         return nil, err     }     if err := fallibleOperationB(a);  err !=  nil {         return nil, err     }     c, err := fallibleOperationC(a)     if err !=  nil {         return nil, err     }     fallibleOperationD(a, c)     return fallibleOperationE()

If you nest them, God will help you, or want to do something more interesting than sending errors back to the stack.

 Nil__
Translated at 17:58 on January 22, 2019
top
one
All translations in this article are only for learning and communication purposes. Please be sure to indicate the translator, source and link of the article when reprinting.
Our translation work follows CC protocol If our work infringes your rights and interests, please contact us in time.
Loading

Comments( five )

method
Special effect of magic ball
Machine turning is OK
 listenerri
listenerri
Is this also something translated by three people? Don't you read it yourself?
 Snow Dream Technology Posthouse
Snow Dream Technology Posthouse
What kind of translation
 CandySunPlus
CandySunPlus
The turnover is invincible...
J
J Youge
What the hell is the translation
 Back to top
Top