3 ms·
This isn't true. Throwing an exception is a perfectly valid operation. Of course, it is not the operation you want, but that's a-whole-nother matter.
by catnaroek 10y ago
This isn't true. Throwing an exception is a perfectly valid operation. Of course, it is not the operation you want, but that's a-whole-nother matter.
- tempodox 10y agoI didn't say throwing an exception is an invalid operation. How does your dynamic language tell its user an operation is invalid, based on argument type?
- catnaroek 10y ago> How does your dynamic language tell its user an operation is invalid, based on argument type? It doesn't! That's exactly the point. If something is invalid, then it can't happen. At all.
- tempodox 10y agoIf only. What language are you talking about, exactly? This unicorn I have to see.
- catnaroek 10y agoAny memory-safe language? Say, Python. `[] / []` is a perfectly valid operation: its result is a raised exception misleadingly called `TypeError`. OTOH, in most typed languages, this is a genuinely invalid operation, and it can't happen at all.