|
|
|
|
|
by nsguy
701 days ago
|
|
I think the OP's point was that '/' is not a mathematical divide anyways. Sure, we can remove '/' and make that a happy face emoji but I don't think that changes the premise here. Making sure you don't divide by zero is just one of those things programmers learn... like making sure you don't derefence null or go beyond the size of your array, or overflowing... not clear to me that masking that helps, maybe the ship wouldn't strand but instead it'd run into a bridge. |
|
Disagree. The whole point of calling it '/' is to tell the reader that it is mathematical division.
> Making sure you don't divide by zero is just one of those things programmers learn... like making sure you don't derefence null or go beyond the size of your array, or overflowing... not clear to me that masking that helps, maybe the ship wouldn't strand but instead it'd run into a bridge.
In all of those cases it's much better for your program to explode quickly and loudly than silently continue (e.g. you'd hope dereferencing null triggered an error rather than just letting your program continue). Defining x/0 = 0 is masking the error and continuing, which tends to lead to corrupt data and silent wrong results.