GO谚语你知道多少

GO谚语你知道多少

  1. 不要通过共享内存来通信,通过通信来共享内存(Don’t communicate by sharing memory, share memory by communicating)。
  2. 并发不是并行(Concurrency is not parallelism)。
  3. 通道是协调的,互斥是串行的(Channels orchestrate; mutexes serialize)。
  4. 接口越大,抽象性越弱(The bigger the interface, the weaker the abstraction)。
  5. 让零值变得有用(Make the zero value useful)。
  6. interface{} 什么也没说(interface{} says nothing)。
  7. Gofmt 的风格没有人喜欢,但 Gofmt 却是大家的最爱(Gofmt’s style is no one’s favorite, yet gofmt is everyone’s favorite)。
  8. 复制一点总比依赖一点好(A little copying is better than a little dependency)。
  9. Syscall 必须始终用 build 标签来保护(Syscall must always be guarded with build tags)。
  10. Cgo 必须始终用构建标签来保护(Cgo must always be guarded with build tags)。
  11. Cgo 不是 Go(Cgo is not Go)。
  12. 使用 unsafe 包没有任何保证(With the unsafe package there are no guarantees)。
  13. 清晰的比聪明的好(Clear is better than clever)。
  14. 反射从来不是清晰的(Reflection is never clear)。
  15. 错误就是价值(Errors are values)。
  16. 不要只是检查错误,要优雅地处理它们(Don’t just check errors, handle them gracefully)。
  17. 设计架构,命名组件,记录细节(Design the architecture, name the components, document the details)。
  18. 文档是为用户准备的(Documentation is for users)。
  19. 不要恐慌(Don’t panic)。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据