Skip to content

Add short explanation and examples to individual proverbs. #15

Open

Description

@yannk

Related to #14

It would be nice if longer explanations and examples were provided to illustrate proverbs. There has been numerous talks, blog posts about some of the proverbs. The body of those pages should probably be kept concise too.

Example of what it could read for: "Clear is better than clever."

Go is optimized for readability and developer efficiency.

Example 1:

Go doesn't have ternary operator, one could cleverly write:
return map[bool]int{true: 2, false: -2}[5 > 4]

But it's better to write, the longer, more familiar:

        if 5 > 4 {
              return 2
        } else {
              return -2
        }

TODO: (Add an example in the area of premature optimization)

Example of what it could read for: "Don't communicate by sharing memory, share memory by communicating."

Go has concurrency primitives complementing the usage of traditional locks, mutexes and semaphores:
See: https://blog.golang.org/share-memory-by-communicating

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions