4 ms·
Yet another language-ergonomics post that confuses essential complexity (the function is doing complex business logic that happens to be necessary) with acciden
by omginternets 3y ago
Yet another language-ergonomics post that confuses essential complexity (the function is doing complex business logic that happens to be necessary) with accidental complexity (in this case: having to type more).
With this distinction in mind, the entire article boils down to two points:
1. The author is basically complaining about having to type more (fair, but not interesting)
2. The author proposes that appending a "!" to a statement is somehow clearer than explicitly returning an error value (absurd and eyebrow-raising)
The whole article then becomes "I like Rust's syntax better".
- ColonelPhantom 3y agoHaving a common idiom for common operations like error propagation is not "absurd and eyebrow-raising". What sounds absurd to me is obscuring the actually interesting control flow significantly in favor of either showing the trivial control flow or alleviating the need to learn the one (1) single operator that represents said trivial control flow.
- omginternets 3y agoYes, but we do have a common idiom for error-propagation in Go. It's more explicit than the proposed alternative, in fact.
- lmm 3y agoYou don't have an idiom, you write it out longhand every time, which ends up obscuring the important control flow and business logic under a pile of ceremonial repetition.
- omginternets 3y ago"if err != nil {...}" is the idiom, my friend.