4 ms·
>you're just required to be explicit about which approach you're taking Yes and I'm opposed to such "if err != nil" boilerplate.
by stackghost 2y 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.
- worik 2y ago> Yes and I'm opposed to such "if err != nil" boilerplate. That is not what Rust boilerplate looks like.
- stackghost 2y agoI'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.
- 6equj5 2y agoAnd you're not opposed to try-catch boilerplate?
- stackghost 2y agoBoilerplate 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?