《The Go Programming Language》推荐理由

  《The Go Programming Language》,中文翻译为《Go语言圣经》[1],是学习Go语言极为推荐的入门读物。理由如下:

  1. 案例丰富。从最简单的hello world到复杂的反射,都有详细的案例。
  2. 行文生动。书中的用语简练生动,常常看到幽默的表达,如书中第100页中一个例子中写道:

dilbert.Salary -= 5000 // demoted, for writing too few lines of code

  1. 内容详实。因为本书的作者有亲身参与到Go语言的设计和实现,所以对一些底层的逻辑有深入的说明,如书中第9页对map的无序性说明:

The order of map iteration is not specified, but in practice it is random, varying from one run to another. This design is intentional, since it prevents programs fro m relying on any particular ordering where none is guaranteed.

  此外,书中对于Go语言编程中的关键问题给出了全面的解答,如书中第260页中介绍的竞争处理方式:

We’ll repeat the definition, since it is so important: A data race occurs whenever two
goroutines access the same variable concurrently and at least one of the accesses is a write. It follows from this definition that there are three ways to avoid a data race.

  1. 总之非常的Go。Go语言给人的印象是简洁、高效,让人享受编程,本书也一样。在本书的最后,作者写道:

For now, put the last two chapters in the back of your mind. Write some substantial Go programs. Avoid reflect and unsafe; come back to these chapters only if you must.
Meanwhile, happy Go programming. We hope you enjoy writing Go as much as we do.

Reference

[1] 官网 The Go Programming Language

你可能感兴趣的:(golang,开发语言,后端)