Skip to content

typo in lambda discussion #41

@zolia

Description

@zolia
func main() {
  ...
  datastore.Do(compare(data))
  ...
}

should be:

func main() {
  ...
  datastore.Do(concat(data))
  ...
}

I usually discourage the use of lambdas, but where are some situations when they really improve convenience for developers like time.AfterFunc(duration int, func()) or registering various handlers like: ch.Handle(conn.TopicInit, func(c conn.Context) error or famous type HandlerFunc func(ResponseWriter, *Request)

Lambas impairs the readability and traceability of a code in many cases, especially if the codebase is complex. IDEs also usually having trouble handling them properly, thus it might be hard to trace where certain lambda function originates from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions