The Go Programming Language

Alan A. A. Donovan ยท Brian W. Kernighan
Addison-Wesley, 2015 (2nd Edition)

Chapter 6: Methods

6.1. Method Declarations

p 156
In Go, we don't use a special name like this or self for the receiver [...] Since the receiver name will be frequently used, it's a good idea to choose something short and to be consistent across methods. A common choice is the first letter of the type name, like p for Point.

Chapter 10. Packages and the Go Tool

10.6. Packages and Naming

p 289
Be descriptive and unambiguous where possible.

10.7.4. Documenting Practices

p 296
Good documentation need not be extensive, and documentation is not a substitute for simplicity. Indeed, Go's conventions favor brevity and simplicity in documentation as in all things, since documentation, like code, requires maintenance too. Many declarations can be explained in one well-worded sentence, and if the behavior is truly obvious, no comment is needed.

Chapter 11. Testing

11.2.6. Avoid Brittle Tests

p 317
An application that often fails when it encounters new but valid inputs is called buggy; a test that spuriously fails when a sound change was made to the program is called brittle. Just as a buggy program frustrates its users, a brittle test exasperates its maintainers. The most brittle tests, which fail for almost any change to the production code, good or bad, are sometimes called change detector or status quo tests, and the time spent dealing with them can quickly deplete any benefit they once seemed to provide.

11.3. Coverage

p 318
As the influencial computer scientist Edsger Dijkstra put it, “Testing shows the presence, not the absence of bugs.”

[...] Coverage can't be quantified directly—the dynamics of all but the most trivial programs are beyond precise measurement—but there are heuristics that can help [...]


Book, Errata,
Sofware
Marc Girod
Fri Oct 8 10:47:09 2021