Open rodrigob opened 6 years ago
This is definitely a controversial point, and I agree the docs could/should be expanded so we can make our case.
Someone could reasonably review how error
is used in the stdlib for this issue. I am willing to work with someone on reducing observations in stdlib down to idioms which can be presented as readily understood examples.
In https://github.com/ponylang/pony-tutorial/blob/9cfbb3ee7e3e8adbc7b8d914ff440f9482ae8bea/expressions/exceptions.md#comparison-to-exceptions-in-other-languages
the pony exceptions are compared to other languages. It is argued that not having error types or instances is better. It would be great to point to some code examples for commonly used idioms regarding usage of the
error
feature.In particular, if my
try-else
block can fail in two different ways, what is the recommended way to handle this inside the else ? (splitting thetry-else
in two ? nesting ?)I think "no exceptions" or "no exception values" tends to be as controversial as "no generics" (like Go did). So best to provide concrete "real world" examples.