Lucky bunch indeed. I'm 9 months in and still missing map(), flatMap(), let alone more advanced FP.
I guess this is a matter of personal preference, but I definitely consider:
users.filter(_.active).map(_.email)
to be easier to read (and not a pain in the ass to type) than:
emails := make([]string, 0)
for _, u := range users {
if u.active {
emails = append(emails, u.email)
}
}
return email
The first style is more explicit about
what you want to do, the second style is more explicit about
how you want to do it. Go made imperative vogue again, but for me it feels like a throwback all the way to Turbo Pascal. Sure, the Go compiler is really fast, but Turbo Pascal would beat it hands down - on 20Mhz machines with 1MB of RAM.