this post was submitted on 30 Jun 2024
236 points (97.2% liked)

Programmer Humor

31230 readers
67 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 4 years ago
MODERATORS
 

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 comment's thread
view the rest of the comments
[–] [email protected] 1 points 3 days ago

When passing or storing data in code you usually have to specify what type of data is it. An int is an integer, so numbers, there's also boolean (true/false) and many others. There's also string which is just characters of any kind (for the most part) which pretty much makes it a catch-all, since numbers can be a string along with letters and special characters.

But to use a number as a number after it's been received as a string it has to be converted to an int, which means extra code, more effort, more failure points etc etc.