this post was submitted on 30 Jun 2024
571 points (98.1% liked)
Programmer Humor
19587 readers
2138 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's the API's job to validate it either way. As it does that job, it may as well parse the string as an integer.
Or even funnier: It gets parsed in octal, which does yield a valid zip code. Good luck finding that.
Who tf decided that a 0 prefix means base 8 in the first place? If a time machine was invented somehow I'm going to cap that man, after the guy that created JavaScript.
Should be like
0o777
to mimic hex0xFF