3 ms·
This is a case of poor abstraction. Many commenters in this thread explain why, in their application, 0 is a good fallback for division by zero. But, falling b
by gwbas1c 8y ago
This is a case of poor abstraction. Many commenters in this thread explain why, in their application, 0 is a good fallback for division by zero.
But, falling back to 0 is not the correct error handling result for all situations. In other situations, an error is the correct result. The language designers should include proper division, and this style of division should be labeled a "safe" division; or, a division that throws an error should be labeled an "unsafe" division.
I have serious doubts about a language if it chooses one-size-fits-all error handling like this.