《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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值