240
submitted 2 weeks ago by [email protected] to c/[email protected]

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] 22 points 2 weeks ago

All of us fintech devs however, know the true horrors. Make everything a string, lest ye end up in precision hell

[-] [email protected] 10 points 2 weeks ago* (last edited 2 weeks ago)

You are a fintech dev using floating point? And your advice is to encode things as strings?

...

This is why I got out of fintech.

(I am sorry, I know there are horrors and I am sure I am not familiar with your exact scenario.)

Edit: just for anyone who passes by: try to stick with integers in a currency's smallest unit of division. (This is only one small bit of this problem, but the number of times I have seen currency values in floating point makea me psychotic.)

[-] [email protected] 2 points 2 weeks ago

try to stick with integers in a currency’s smallest unit of division

And then the marketing department comes up with products that cost 1.5ct apiece.

[-] [email protected] 2 points 1 week ago

Oh yeah, and some things like petrol are calculated to fractions of a cent as well

load more comments (2 replies)
load more comments (7 replies)
this post was submitted on 30 Jun 2024
240 points (96.9% liked)

Programmer Humor

31326 readers
19 users here now

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

Rules:

founded 4 years ago
MODERATORS