Hacker News new | ask | show | jobs
by al_mandi 1455 days ago
Incidentally, I've found golang to be more verbose than Java.

Generics help a little bit, but the fact remains that error checking is pervasive and verbose, and you can't chain calls (e.g. slice.Map(func(a int) { return a * 2 }).Filter(func (a int) { return a % 2 == 0}).Reduce(0, func(a int, i int) { return a + i }) is not something that can be supported by golang when errors are involved, not to mention the extreme verbosity since it does not have a short way to pass functions).

1 comments

Yes, writing function chains that compose from left to right, combined with the error checking convention, is a no-starter. So maybe you embed an error, and then check for error non-nil everywhere ? Or does KISS imply that you just panic and recover ? Some intensive googling finds that there's been many attempts to design an easy to use, easy to understand pipelining convention, but I have not found any one of them to be convincing.