3 ms·
> I'd rather have my code fail fast Doesn't it depend on the product in question? In some cases, you want to fail fast and loud. In others, you want to recover
by golergka 10y ago
> I'd rather have my code fail fast
Doesn't it depend on the product in question? In some cases, you want to fail fast and loud. In others, you want to recover at all costs. Sometimes a single calculation going 1/0 means the whole program is failing. Sometimes it's a completely ignorable, minor error, not even worth checking for.
Can we please not have a "default" way of handling errors? None fit all.
- dlubarov 10y ago> Can we please not have a "default" way of handling errors? None fit all. Well language designers have to make the choice. I think overall, the best approach is Python's behavior, where both 1/0 and 1.0/0.0 trigger a ZeroDivisionError.
- detaro 10y agoThey could give options. E.g. have a "throwing float" and a "NaN float" as distinct data types, or some other way to parametrize the behaviour. Is that a good idea? I don't know.
- golergka 10y ago> Well language designers have to make the choice. Of course. I meant, no "default" that we would consider the "right way" for all the languages.