Hacker News new | ask | show | jobs
by Cthulhu_ 2528 days ago
Does anyone know if this was a conscious decision? I mean IIRC in Java you're generally discouraged from throwing errors for control flow because creating the stack trace is a relatively heavy process. In Go this is of less concern and returning an error is pretty normal for control flow (as in errors are expected, not exceptional), and you shouldn't have to worry that an error path would be 100x as expensive as a normal flow because a stack trace is being generated.
1 comments

Java allows since ~a decade time to omit the generation of stacktraces, for exactly such cases