3 ms·
Banking apps, e-commerce websites, stock exchange platforms, we interact with money daily. We also increasingly rely on technology to handle ours. Yet, there’s
by reaperducer 8y ago
Banking apps, e-commerce websites, stock exchange platforms, we interact with money daily. We also increasingly rely on technology to handle ours.
Yet, there’s no consensus around how to programmatically handle monetary values.
I wonder if the average person would find this frightening.
- rpeden 8y agoI don't think it's true that there's no consensus around how to programatically handle monetary values. Maybe there's no consensus around how to do it in JavaScript. In the Java world, there's JSR-354: https://jcp.org/en/jsr/detail?id=354 https://jcp.org/en/jsr/detail?id=354 Cobol has handled money well for decades. .NET has Decimal, which should handle money correctly as long as you're working with values less than 79.2 octillion. In my part of the world, at least, big banks tend to be mostly Java and Cobol on the back end. You'll definitely see Node, Go, and others being used for various tasks throughout the company, but when it comes to keeping track of money and moving it around, it's primarily Java and Cobol doing the heavy lifting. That's what I've heard from other developers, anyway. I haven't worked at a bank myself.
- kickopotomus 8y agoExactly correct. More stuff than most people expect is still handled by COBOL. I haven't worked with a bank in a few years, but back in 2015 the one I was at was attempting to migrate a lot of the COBOL tasks to Java.
- deleted 8y ago[deleted]
- zie 8y agoIBM has had a solution for a long time: http://speleotrove.com/decimal/decarith.html http://speleotrove.com/decimal/decarith.html Python uses it: https://docs.python.org/3.5/library/decimal.html https://docs.python.org/3.5/library/decimal.html Just because JS is stupid doesn't mean other languages are.
- TeMPOraL 8y ago> Just because JS is stupid doesn't mean other languages are. This bewilders me. They keep cramming so much new stuff into JS these days - arrow operators, promises, async/await, God knows what, but not ints? I'm not asking for the whole numeric tower of Lisp languages, I can live without rationals and bignums and complex numbers. But a God's own fixed-width integer. You'd think they'd add it in the years since JS started being used for serious things.
- pbowyer 8y agoDouglas Crockford has talked about JavaScript's number handling, and it makes for a good listen. It's in https://www.youtube.com/watch?v=DxnYQRuLX7Q https://www.youtube.com/watch?v=DxnYQRuLX7Q and there's a follow-up in https://www.youtube.com/watch?v=oYFU0gkAYdc https://www.youtube.com/watch?v=oYFU0gkAYdc