Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
IMHO, the biggest advantage of COBOL is that it is so widely known and runs on every major hardware/software platform in the computer industry (Mainframe, UNIX, Win-based).
1&2. Both are quite acceptable for business applications (as opposed to, say, Operations Research or real-time targeting). The capabilities of cobol are mostly limited by the skill/experience of the designer/developer.
3. Millions of money transactions are run every minute that are completely accurate. . . The biggest "problem" i'm aware of is that often programmers do not provide for enough precision (decimal places) in intermediate results during a calculation. I suspect there may be more to your question.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
Typically, a language is not selected for data processing speed or volume or accuracy of mathematical operations. I doubt there's been many comparisons of languages based on these factors, since changing the underlying hardware could impact all of them.
More important considerations for language use are environment (embedded systems versus online versus batch ...), stability of the language and hardware, ease of learning, ease of maintenance, and capability to handle the problem(s) being addressed.
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
and finding people who are competent in the language.
as indicated by both Dick and Robert: COBOL runs on all platforms.
as far as speed, etc... each manufacturer provides a basic assembler language:
IBM - HLASM high level assembler
NCR - NEATVS
etc...
but, finding competent programmers (under the age of 50) for assembler programming is problematic.
To get a job as a COBOL programmer,
you only need to have experience in COBOL
(any platform - PC, IBM Mainframe, NCR, Tandem, ....)
and little knowledge of the hardware,
(as many questions in all the mainframe forums attest)
many companies thinking that they can train.
To program in assembler, one needs to understand the hardware.
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
Had you not restricted your answers to 1, 2, or 3, I would have said the biggest advantage is readability because of its self-documenting nature, and, as a result, its maintainability.
Bill,
I have an NCR Certificate dated 1966 for a class in 304 NEAT Programming!
I didn't include Readability because, I got too many articles on readability, moreover readability of cobol is self evident.
But for 1,2 & 3, I came across only passing reference, But my point point was why. For example, In one of the site I read, when Java was executed for same file, the Java program took 20 times more time than Cobol. I didn't find these kind of statistics anywhere, also I was not sure why Java will take more time. Same case with Other two point.
Another thing, which I read was Accuracy of Mathmatical calculation. I was reading about Floating Point, and found that floating point is more accurate than fixed point, so how come COBOL is more accurate.
I wanted a proof kind of thing for each point, because people I interacted (in my office) just say that those are plus point....but they don't have idea why those are there in COBOL but not in other language or why they are advantage.
As for discussion about Hardware, I have been coding COBOL for 3 years now(and much less than 50), but yes I don't know anything about hardware.........my company doesn't want me to learn about hardware or assembly language, they are fine with me coding without knowing the basic....I want to learn...but then I guess one can't learn about hardware & assembly language by themselves without getting a hand on.
There is no way to compare languages. You can only compare implementations. For example, Java will be slower than COBOL in most simple cases such as running a java command from a command line with no special compiler options. But depending on the java compiler, it may have a JIT (just in time) compiler that creates native code on the fly. Or some implementations only create native code after the source is interpreted some fixed number of times. Or you can set it up to always interpret or always go to native code. Similarly, with COBOL, you can set runtime debug options that slow it down, or compile it to run quickly. Some implementations will have a runtime dependency like LE and some will not.
Even comparing something to assembler has its problems. An experienced designer can probably make a more efficient COBOL program than an inexperienced designer can for an assembler program (though I think that us unlikely). If the assembler coder uses a bad algorithm for data conversions, sorting or searching for example, the COBOL code might be better.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
This takes me back to college days ... WAY back when!
Interpreted languages are slower than compiled languages since there's the run time overhead of the computer translating each statement into something it can understand -- which is done during the compile process for compiled languages. Java, being basically interpreted (in most cases) will be many times slower than COBOL which is compiled. How much slower? I've heard 10 times, 20 times, 15 times ... I suspect it depends a lot on what is being done.
Realize the difference between accuracy (how close the result is to the "true" result) and precision (how many digits are being carried). COBOL fixed point numbers can be up to 31 digits long, so for integer arithmetic up to 31 digits you can be completely accurate. Numbers larger than 31 digits, however, require floating point and the trade off is you don't get 31 digits of precision with floating point numbers.
In one sense, all Turing-complete computer languages are the same: give them a set of inputs and examine the outputs. Just looking at these two sets of data, you cannot tell which language generated the output. COBOL was designed for processing large amounts of data and allowing very detailed descriptions of it. However, it is quite possible to find cases where COBOL will run slower than another language -- and cases where COBOL will run faster -- for pretty much any language you select. COBOL has some good reasons to be used but I don't think you can categorically state that it has the advantage in data processing speed, data volume processed, or accuracy of mathematical operations -- as is so often, the real answer is that it depends.