Re:COBOL: You’re thinking about it wrong – GCN
by MelvinButtsESQ on Friday March 03, 2023 @10:44AM
(#35011068)
COBOL is easy. JCL is the hard part.
[ Parent
| on HN ]
Re:COBOL: You’re thinking about it wrong – GCN
by cratermoon on Friday March 03, 2023 @10:55AM
(#35011226)
COBOL is good for dealing with money because it was built with the sort of numeric types required as a natural part of the language. Popular programming languages treat them as an afterthought and provide awkward library functions, if they have anything at all.
Re:COBOL: You’re thinking about it wrong – GCN
by AndrewDucker on Friday March 03, 2023 @11:00AM
(#35011301)
C# has Decimal built in. Enough precision for any money-related calculation.
Re:COBOL: You’re thinking about it wrong – GCN
by ElectricalUnion on Friday March 03, 2023 @03:52PM
(#35014833)
Lots of languages have Decimals (and arbitrary precision integers for another example) builtin, but they're usually never the default.
Re:COBOL: You’re thinking about it wrong – GCN
by cratermoon on Saturday March 04, 2023 @01:23PM
(#35023083)
Which of the top 10 languages from the Tiobe index have a decimal type baked^* into the language?
* Is a type in the standard library "baked in"? I lean towards no, but I'll give the language A for effort anyway.
Re:COBOL: You’re thinking about it wrong – GCN
by AndrewDucker on Sunday March 05, 2023 @06:02PM
(#35035170)
1) Python - added to the standard library in 2003.
2) C - no.
3) Java - BigDecimal in the standard library.
4) C++ - no.
5) C# - built in.
6) VB - Currency type kinda does what you'd want, but doesn't scale down very far.
7) Javascript - no. (Use https://github.com/MikeMcl/bignumber.js)
8) SQL - Yes. But check your dialect.
9) PHP - No.
10) Go - No. (Use https://pkg.go.dev/github.com/shopspring/decimal)
Re:COBOL: You’re thinking about it wrong – GCN
by JohnFen on Friday March 03, 2023 @11:42AM
(#35011881)
shiver
That's a fact. A couple of years ago, I had to brush off my JCL skills for a job. It reminded me of why I was so happy when I didn't have to use JCL anymore.
Re:COBOL: You’re thinking about it wrong – GCN
by YeGoblynQueenne on Friday March 03, 2023 @12:09PM
(#35012280)
On the bright side, you can generate all your JCL with Rexx.
Re:COBOL: You’re thinking about it wrong – GCN
by bitfhacker on Friday March 03, 2023 @01:05PM
(#35013022)
Or with chatGPT!!