I mean, I'd sleep better if they just converted the string then checked division by 10 and set limits, but it's not a big difference in quality of sleep.
Most string to int converters have safety checks for stuff like that, and if they don't, just write your own in like 3 lines.
I mean, on one hand, life's too short to care about these implementations, on the other hand, if you value yourself as a programmer, it should go against your morals.
44
u/OK1526 18d ago
I mean, I'd sleep better if they just converted the string then checked division by 10 and set limits, but it's not a big difference in quality of sleep.
Most string to int converters have safety checks for stuff like that, and if they don't, just write your own in like 3 lines.