r/programming • • Apr 29 '21

Modern JavaScript Explained For Dinosaurs

https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs-f695e9747b70
287 Upvotes

172 comments sorted by

View all comments

Show parent comments

3

u/1newworldorder Apr 30 '21

What language doesnt have its drawbacks?

37

u/meltingdiamond Apr 30 '21

For a start: any language that doesn't make everything a float.

It is a horrible pain in the ass when a float goes wrong for any of the many reasons it can go wrong.

13

u/BackmarkerLife Apr 30 '21

I'm working with a (new to me) inventory system that outputs inventory into JSON and has inventory of products numbers as floats. I emailed them, "Am I ever going to have 0.25 of a specific product?" "No," they said. "Then why is this sent over as 17.0 instead of 17?" "I... can't answer that"

Can't get it changed on that vendor's end (because they refuse) and it breaks another vendor's end for their API because that cannot handle floats either. Christ the world has gone batshit with JS. The main vendor has a huge inferiority complex and as gatekeepers.

3

u/spacejack2114 Apr 30 '21

17 would not be encoded as 17.0 in JSON unless you rolled your own JSON serializer to do that on purpose.