Hacker News new | ask | show | jobs
by stackghost 602 days ago
>you're just required to be explicit about which approach you're taking

Yes and I'm opposed to such "if err != nil" boilerplate.

2 comments

> Yes and I'm opposed to such "if err != nil" boilerplate.

That is not what Rust boilerplate looks like.

I'm aware. One of the criticisms often leveled against Go is that it's needlessly verbose when handling errors, which is why I chose that example.
And you're not opposed to try-catch boilerplate?
Boilerplate is code you have to write almost as a pro forma thing. If (in go lang, to continue my example) you're just going to keep copy pasting the same if statement to return `err` up to some higher caller, then why write all those lines when at the top level a single try/catch can remove potentially dozens of lines of code?