- cross-posted to:
- programmerhumor@lemmy.world
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.world
- programmerhumor@lemmy.ml
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…”
I thought JavaScript did that, but it turns out it doesn’t. I thought Java did that, but it turns out it doesn’t. Python did it until version 2.7: https://docs.python.org/2.7/library/functions.html#int. C still does it: https://en.cppreference.com/w/c/string/byte/strtol
Interesting that
strtol
in C does that. I’ve always explicitly passed in base 10 or 16, but I didn’t know it would auto-detect if you passed 0. TIL.