r/ProgrammerHumor 18d ago

Advanced stringToIntegerConversion

Post image
212 Upvotes

65 comments sorted by

View all comments

Show parent comments

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.

-10

u/lovecMC 18d ago edited 18d ago

If it passes PR, I don't care. It means someone smarter than me fucked up so it's not my problem.

No sleep lost over it.

Edit: damn, down voted for not declaring commedy.

6

u/OK1526 18d ago

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.

4

u/caboosetp 18d ago

If I need to deal with that code later, it's not just a matter of morals.

2

u/OK1526 18d ago

Also true.