tags:

views:

99

answers:

5

Can anyone help comparing and contrasting between Java and cobol in terms of technical differences as well as architectural design styles

+1  A: 

It is easier to point out what they have in common instead of listing their differences.

So here is the list:

  1. You can use both to make the computer do things
  2. They both get compiled to yet a different language (machine code, byte-code)
  3. That is it!
Square Rig Master
They both have loops and conditions
Itay Moav
+2  A: 

Similarities

  1. Cobol and Java were going to change the world and solve the problem of programming.

  2. Neither lived up to the initial hype.

  3. There are now very large, bloated Cobol and Java programs that are used by banks and are "legacy" ... too large and critical to rewrite or throw away.

  4. Cobol introduce the idea of having long, readable names in their code. Java recommends long, readable names.

Differences

  1. Cobol was invented by an American, Grace Murray Hopper, who received the highest award by the Department of Defense, the Defense Distinguished Service Medal.

  2. Java was invented by a Canadian, James Gosling, who received Canada's highest civilian honor, an Officer of the Order of Canada.

3 COBOL convention uses a "-" to separate words in names, Java convention uses upper/lower CamelCase.

Larry Watanabe
A: 

Similarities:

  1. Both extremely verbose and created with pointy-haired bosses, not programmers, in mind.
  2. Both used primarily for boring business software.
  3. Both have huge legacy and are going to be around a while.
dsimcha
+1  A: 

Cobol is a pure procedural language, not even functions in it (I used cobol in the 90s, so it might have changed since).
Java is OO (Although I heared there is a OO version for Cobol too), Oh...And the syntax is different.

Itay Moav
+1  A: 

COBOL was popular for the simple reason, to develop business applications.

Since the syntax was so clear and human-like, written in procedural style, it was for that reason, that made adapting to the changes in the business environment much easier, for example, to assign a value of pi to a variable, and then subtract zero from it - simple example to show the actual COBOL statements/sentences (it is years since I last programmed in Cobol)

MOVE 3.14 INTO VARPI.
SUBTRACT ZERO FROM VARPI GIVING VARPIRESULT.
IF VARPIRESULT AND ZERO EQUALS VARPI THEN DISPLAY 'Ok'.

If I remember, the COBOL sentences have to be at column 30...

And it is that, hence easier to troubleshoot because any potential business logic error can be easily pin-pointed as a result. Not alone that, since COBOL ran on mainframe systems, it was for a reason, the data transfer from files were shifted at a speed that is light-years ahead of the other systems such as PC's and that is another reason why data processing in COBOL was blindingly fast.

I have worked on the Y2k stuff on the mainframe (IBM MVS/360) and it was incredible at the dawn of the 21st century, praying that the fixes I put in wouldn't bring the business applications to their knees...that was hype, aside from that..to this day, it is still used because of the serious transfer speed of data shuffling around within mainframes and ease of maintainability.

I know for starters, Java would not just be able to do that, has Java got a port available for these mainframes (IBM MVS/360, 390, AS400)?

Now, businesses cannot afford to dump COBOL as they would effectively be 'committing suicide' as that is where their business applications resides on, which is the reason why the upgrade, migration, porting to a different language is too expensive and would cause a serious headache in the world of businesses today...

Not alone that, imagine having to rewrite procedural code which are legacy code and could contain vital business logic, to take advantage of the OOP style of Java, the end result would be 'lost in translation' and requiring a lot of patience, stress and pressure.

Imagine, a healthcare system (I have worked for one, which ran on the system I mentioned above), was to ditch all their claims processing,billing etc (written in COBOL) to Java, along with the potential for glitches and not to mention, serious $$$ amount of money to invest which would cost the healthcare company itself far more, the end result would be chaos and loss of money, and customers (corporations that offer employee benefits) would end up dumping the company for a better one.

So to answer your question, I hope I have illustrated the differences - to summarize:

COBOL is:

  • Procedural language
  • Simple human like syntax
  • very fast on mainframe systems
  • Easy to maintain code due to syntax

In contrast,

Java is:

  • Object Oriented
  • Syntax can get complicated
  • Requires a Java Virtual Machine to run and execute the compiled bytecode.

Hope this helps, Best regards, Tom.

tommieb75
There is a project going on at this moment at my client's place where a decade old COBOL app running on a mainframe is being retired and replaced with a Java based alternative that was written in about 6 months simply because maintaining the mainframe is proving to be way too expensive. At first everybody was a little worried (and probably still are) at replacing a system that has "evolved" over many years into a humongous blob with God knows that logic and validations! But the new system seems to be showing promise. But you're right, we never heard of perf problems with the mainframe.
Ranju V
@Ranju V: Wow! Good luck with the migration strategy...Hope it all works out, that must have been a big risky business decision... fingers crossed..I would love it if you could post back here on how it goes and that would be invaluable for others to read up on... :)
tommieb75