News for hackers. Stuff that matters.
Re:It’s COBOL all the way down by amelius on Tuesday May 01, 2018 @08:21AM (#16966379)
What makes COBOL cool compared to, say, JavaScript, which can do everything COBOL can and more (such as pass functions/closures around, etc.)?
Re:It’s COBOL all the way down by aetherspawn on Tuesday May 01, 2018 @08:39AM (#16966496)
The programs are very uniform. There is not multiple ways of doing things (at a presentation level). So you get to use hundreds of thousands of existing apps written over the last N decades in your modern web application.

You just couldn’t write them all over again, there isn’t a team on earth that could, even with infinite money. You’d be talking, I think, more than high double digits, millions of LOC.

JavaScript by comparison .. today it’s React/Angular, but it is very fluid. Not much code will be practically reusable in 5/yr from now.

Re:It’s COBOL all the way down by gtycomb on Tuesday May 01, 2018 @09:08AM (#16966703)
> There is not multiple ways of doing things (at a presentation level).

Love the insight. Established businesses like banks look for this kind of stability. And upstarts who build from ground up to challenge status quo, they go on to figure out ways to win with es6 and their friends.

Re:It’s COBOL all the way down by onion2k on Tuesday May 01, 2018 @11:09AM (#16967632)
Not much code will be practically reusable in 5/yr from now.

Is that really true? If you look at a lot of JS from 5, 10 or even 20 years ago it still works. The main things that stop it working are security changes, which is arguably a good thing. I don't see why many of today's JS libs will stop working in the future unless there's a good reason why they should.

Re:It’s COBOL all the way down by ams6110 on Tuesday May 01, 2018 @11:19AM (#16967745)
It's not that they won't work, but that nobody will be doing anything new in JS in 10 years. It will become forgotten, mysterious, scary -- like COBOL is today.
Re:It’s COBOL all the way down by onion2k on Tuesday May 01, 2018 @11:53AM (#16968129)
I can't say I agree, but secretly I hope you're right because I'll make a fortune consulting on people's old web apps.
Re:It’s COBOL all the way down by leanthonyrn on Tuesday May 01, 2018 @01:07PM (#16968942)
How does one search and utilize the use hundreds of thousands of existing apps written over the last N decades? Is their a CPAN like tool for COBOL?
Re:It’s COBOL all the way down by reitanqild on Tuesday May 01, 2018 @01:34PM (#16969263)
I'd guess

1. They are already in place and in use.

or

2. Vendor/consultant is aware of them.

Re:It’s COBOL all the way down by leanthonyrn on Tuesday May 01, 2018 @08:28PM (#16973078)
I see. First rule of COBOL club. Don't talk about COBOL club.
Re:It’s COBOL all the way down by amelius on Tuesday May 01, 2018 @09:10AM (#16966722)
That makes sense. In this view, how well would a modern, purely functional language do, compared to COBOL?
Re:It’s COBOL all the way down by pjc50 on Tuesday May 01, 2018 @11:11AM (#16967651)
That depends on how well it inter-links with COBOL, surely?
Re:It’s COBOL all the way down by ibiza on Tuesday May 01, 2018 @09:32AM (#16966874)
It gives you correct answers to simple questions like this:

    > console.log(0.1 * 0.1)
    0.010000000000000002
Re:It’s COBOL all the way down by trcollinson on Tuesday May 01, 2018 @10:17AM (#16967193)
I’m not sure I get your joke. Every system, JavaScript, COBOL, C, Java, etc etc etc, has this behavior. Floating point decimals when converted to binary, are a rather rough thing for a system to handle. For example, 0.1 in binary is a repeating number. Basic operations on those binary values are very very fast but not always 100% accurate due to the binary nature of decimals. There are packages which allow for very precise floating point calculations but will cause performance degradation compared to the basic operations. It all depends on what you need.
Re:It’s COBOL all the way down by wolfgang42 on Tuesday May 01, 2018 @11:13AM (#16967670)
COBOL uses fixed-point decimal arithmetic, not binary floating-point. You'd declare these variables as PIC V99 and then get a nice neat .10×.10=.01 (or as PIC 99V999 and get 00.100×00.100=00.010, or whatever). This is because it's a Business-Oriented Language, and businesses don't want floating point rounding errors in their finances.

Incidentally, this was actually faster than binary floating-point on the machines for which COBOL was designed, which used EBCDIC and had special circuitry for arithmetic on binary-coded-decimal numbers. You could operate directly on the decimal representation without having to do any conversion for I/O.

Re:It’s COBOL all the way down by rst on Tuesday May 01, 2018 @12:56PM (#16968847)
Nit: the COBOL spec dates to 1960; EBCDIC came later, ~1963. In 1960, character codes were specific to the manufacturer, and sometimes to the machine. IBM had a 6-bit BCD code that was mostly consistent across its line, but Univac had its own which was quite different.
Re:It’s COBOL all the way down by amelius on Tuesday May 01, 2018 @12:08PM (#16968314)
Intel x86 can also work natively with BCD numbers.

https://en.wikipedia.org/wiki/Intel_BCD_opcode

Re:It’s COBOL all the way down by bashook on Tuesday May 01, 2018 @01:27PM (#16969177)
Very cool. Unfortunately it's no longer supported in Long mode (x86-64). :-(
Re:It’s COBOL all the way down by upofadown on Tuesday May 01, 2018 @04:13PM (#16971050)
I used to do a lot of BCD in embedded POS stuff. No one will miss it. You can do anything you can do in BCD with regular integers if you have any understanding of integer arithmetic. Yeah, it is going to take a little more time to convert to/from decimal digits you can display/input but processors these days have fast integer division so that doesn't matter.

A current issue is that a lot of programmers are bad at integer arithmetic. It isn't really taught in school.

Re:It’s COBOL all the way down by amelius on Tuesday May 01, 2018 @10:53AM (#16967467)