Go Proverbs: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 14: Line 14:
* gofmt's style is no one's favorite, yet gofmt is everyone's favorite.
* gofmt's style is no one's favorite, yet gofmt is everyone's favorite.
* A little copying is better than a little dependency.
* A little copying is better than a little dependency.
* Syscall must always be guarded with build tags.
* Syscall must always be guarded with [[Go_Build_Tags#Overview|build tags]].
* Cgo must always be guarded with build tags.
* Cgo must always be guarded with [[Go_Build_Tags#Overview|build tags]].
* Cgo is not Go.
* Cgo is not Go.
* With the unsafe package there are no guarantees.
* With the unsafe package there are no guarantees.

Latest revision as of 22:05, 7 March 2024

Internal

Overview

Rob Pike's:

  • Don't communicate by sharing memory, share memory by communicating.
  • Concurrency is not parallelism.
  • Channels orchestrate; mutexes serialize.
  • The bigger the interface, the weaker the abstraction.
  • Make the zero value useful.
  • interface{} says nothing.
  • gofmt's style is no one's favorite, yet gofmt is everyone's favorite.
  • A little copying is better than a little dependency.
  • Syscall must always be guarded with build tags.
  • Cgo must always be guarded with build tags.
  • Cgo is not Go.
  • With the unsafe package there are no guarantees.
  • Clear is better than clever.
  • Reflection is never clear.
  • Errors are just values.
  • Don't just check errors, handle them gracefully.
  • Design the architecture, name the components, document the details.
  • Documentation is for users.
  • Don't panic.