3 ms·
I see this behavior as implicit error silencing. Wouldn't you prefer seeing: foo .? bar . baz .? roo To know that nil is not even a possibility for `bar`?
by Peaker 11y ago
I see this behavior as implicit error silencing.
Wouldn't you prefer seeing:
foo .? bar . baz .? roo
To know that nil is not even a possibility for `bar`?
Why not make the nil check (or error silencing) explicit when it is so cheap to do so?
- Udo 11y agoI already talked about my reasoning. But you are correct when you say this is a form of implicit error silencing. Dynamic languages usually have many features which could be described as implicit error silencing, and even statically typed ones often do. Implicit type conversions would be an example. You could very well argue any behavior that deviates from how the processor architecture handles data types and conditionals constitutes a silenced error of some kind. The question becomes where you personally draw the line.
- Peaker 11y agoIndeed I believe in Python's motto of "Errors should never pass silently. Unless explicitly silenced." I think that Javascript's silencing of wrong parameter counts, Perl's (non-strict) allowing string concat, and non-well-founded implicit coercions (i.e: ones that change the semantics of the value) are all terribly horrible. I believe that those who value convenience over safety deserve neither and will lose both.