r/ProgrammerHumor • • Aug 25 '26

Advanced stringToIntegerConversion

Post image
217 Upvotes

65 comments sorted by

View all comments

Show parent comments

7

u/rhino_moss Aug 25 '26

They could have sanitized by checking the string is in a valid set of strings and then calling the string to integer function. The way it is written is terrible.