"Go Programming Language" Chinese version translation error

"The Go programming language" is a very well written book. I originally bought the Chinese version to read it, but after turning a few pages, I really couldn't understand it. So I bought an English version to compare and read. I thought it might be more difficult to read English, but I didn't expect English to read more fluently than Chinese. At the same time, many errors in the translation of the Chinese version were found, so please record them here.

  1. page101, "We can ignore the entire log", it should be "We can ignore the entire error"

  2. page101 "After error checking, failures are usually detected before success." It should be "After error checking, first perform error handling, and then process normal logic"

  3. page101 "Followed by the actual function body until the end" The last sentence missed the translation "to minimize indentation".

  4. page101 "Occasionally, a program must take different measures for different types of errors." It should be "However, sometimes the program needs to take different processing methods according to different types of errors that occur."

  5. English version P132, Chinese version P102
    "and they can be assigned to variables or passed or returned from other functions", should be:
    "Moreover, they can be assigned to variables or passed to other functions, or returned from other functions"

  6. English version P133, Chinese version P103
    "Such code organization provides callers with a lot of flexibility" The suggestion is changed to:
    "Such code organization provides callers with great flexibility"

  7. English version 30, Chinese version 22
    "Package level initialization is performed before main starts" should be:
    "Package level variable initialization is performed before main function starts"

"The initialization of local variables is carried out during the execution of the function like the declaration" should be:
"The initialization of local variables is carried out when the function encounters its declaration statement"

  1. English version 31, Chinese version 23
    "Short variable declaration does not need to declare all variables on the left side" suggest to change:
    "Short variable declaration does not need to declare all variables on the left side of :="

"If some variables are declared in the same lexical block, then for these variables, the behavior of short declaration is equivalent to assignment" should be changed to:
"If some variables have been declared in the same lexical block, then for these variables, The behavior of short declaration is equivalent to assignment"

already no translation causes Chinese meaning error

  1. English version P32, Chinese version P24
    "Variables sometimes use an addressed value" should read:
    "Variables are sometimes described as addressable values"

  2. English version P35, Chinese version P27
    "There is one exception to this rule: the types of two variables do not carry any information and are zero values, such as struct{} or [0]int. In the current implementation, they have the same address." This A translation is completely wrong, the English original is
    "There is one exception to this rule: two variables whose type carries no information and is therefore of size zero, such as struct{} or [0]int, may, depending on the implementation, have The same address."
    should be translated as:
    "There is one exception to this rule: the types of two variables do not carry any information, so their size is 0, for example, struct{} or [0]int, may have the same address, depending on For concrete realization."

  3. English version P35, Chinese version P27
    "A new entity is created each time a statement statement is executed, and the variable survives until it becomes inaccessible, and the storage space it occupies is reclaimed." It should read:
    "Every time a statement statement is executed Create a new instance, the variable will survive until it becomes inaccessible, at which time the memory it occupies may be reclaimed"

The difference between the two characters means different things. A variable is not referenced, then its life cycle is over, but it may not be collected immediately, and there may be some delay. This depends on how the specific garbage collection algorithm is implemented.

  1. English version P36, Chinese version P26
    "Even if the loop containing it has returned, its existence may continue" should be:
    "Even if the function containing it has returned, its existence may continue"

13. The English version of P36, Chinese version P26
"The compiler can choose to use the space on the heap or stack to allocate" a translation error
text is
"A compiler may choose to allocate local variables on the heap or on the stack but, ..."
is That said, the compiler can choose to allocate local variables on the stack or on the heap. Note that the local variables are local variables and there is no mention of package-level variables.

14. English version P36, Chinese version P26

"It's amazing that this choice is not based on using var or new keywords to declare variables." Translation error
In go, new is a predefined function, not a keyword, so in the original English, it was deliberately avoided. The
word keyword is the original English text:
"this choice is not determined by whether var or new was used to declare the variable."
should be translated as:
"This choice is not determined by whether var or new was used to declare the variable. "

Guess you like

Origin blog.csdn.net/ww1473345713/article/details/95533950