Meme transcription:

Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?

Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”

You are viewing a single thread.
View all comments
6 points

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.

permalink
report
reply
6 points

I refuse to validate data that comes from the backend I specifically develop against.

permalink
report
parent
reply
8 points

permalink
report
parent
reply
16 points
Deleted by creator
permalink
report
parent
reply
17 points

Or even funnier: It gets parsed in octal, which does yield a valid zip code. Good luck finding that.

permalink
report
parent
reply
3 points

Oof.

I guess this is one of the reasons that some linters now scream if you don’t provide base when parsing numbers. But then again good luck finding it if it happens internally. Still, I feel like a ZIP should be treated as a string even if it looks like a number.

permalink
report
parent
reply
5 points

Well shit, my zip code starts with a 9.

permalink
report
parent
reply
3 points

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.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

Community stats

  • 2K

    Monthly active users

  • 861

    Posts

  • 14K

    Comments