tags:

views:

369

answers:

12

I am constantly reading about how much Cobol code is still in production. And the main reason that it hasn't been updated into am more modern language is that it would take too long/cost too much.

My question is: If there was a tool that converted Cobol to, say, Java, would any organizations find it useful? Or would they rather continue maintaining what they know already works?

+2  A: 

Why fix what ain't broken?

AraK
If it isn't broken yet, it means it doesn't have enough features. - *an engineer*
voyager
+3  A: 

One will always find tools to convert one language to another - they usually go by the term "compilers".

There is always a shortcoming with compilers that have to perform the task of converting code in language X to language Y, especially when the said code was written by a person. That shortcoming happens to be the fact that readbility is often lost in the process of translation. There is no guarantee that the code compiled from COBOL to Java will be understood by any programmer, so in effect the cost of translation has actually increased. In fact, it is difficult to define readability in such a context.

Lack of readability and understandability translates into lack of knowledge of runtime behavior of the translated code. Besides there is no guarantee that people understand the original code completely; surely they do understand bits and pieces of it.

Vineet Reynolds
+3  A: 

Any conversion tool would have risks associated with it, and the resulting code would have to undergo a lot of testing.

Given that a lot of these systems are in use daily to run a business, a lot rides on the continuing operation. So it is not just "how long" or "how expensive", but can we trust it to work 100% the same.

crashmstr
+1 for "can we trust?". You essentially need to retest the whole application.
Thorbjørn Ravn Andersen
No, actually you don't. What you need to do is to test the conversion tool to make sure that it translates each and every construct and compositions of such correctly. This is how people test compilers. If you couldn't do this, you couldn't trust your compiler to generate machine code that matched your C++ code. True, you can't do it perfectly. But you can do it pretty well. Compilers are extremely reliable technology for translation. You can't skimp on the compiler testing, agreed.
Ira Baxter
+1  A: 

I think some organizations could find it useful, particularly organizations where interfacing with/designing around legacy code has become more costly and problematic than converting the code to Java (or another language)

while ( (CostToPortToJava > CostOfNotPortingOverTime++) && DoesLegacyCodeStillWork() )
{
 StayWithLegacyCode();
}

PortCodeToJava();
instanceofTom
+2  A: 

Probably a little of both. There are companies that provide tools and services for conversion using both automated and manual techniques.

Many companies, however, follow the "ain't broke" philosophy, which is likely as wise as anything. Especially since many conversions result in attempts to "improve" the existing system or try to introduce modern software design/construction philosophies and result in a mess.

Dan Fleet
A: 

I believe that you might be looking for this:

http://media-tech.blogspot.com/2009/01/project-naca-migration-from-ibm.html

Max A.
+2  A: 

Many systems written in Cobol have many transactions going though them. They work well on the mainframe platforms that they run on. It would be risky to change them just for the sake of change.

Cathy Sullivan
+6  A: 

Currently, a large volume of the COBOL code (I'd estimate well over 90%) is untestable.

No one knows what it really does.

They know that -- minimally -- it does the expected job most of the time. And when it doesn't, the bugs are known.

Worse, some percentage of COBOL is just workarounds for bugs in other parts of the COBOL.

Therefore, if you subject it to any scrutiny, you'll find that you don't know what's really going on. You can't create test cases.

Indeed, you'll find that most organizations can't even agree on what's "right". But they're willing to compromise on what's available.

The cost and risk of examining the core business processing is unthinkable.

S.Lott
Agreed. There's an insane amount of COBOL out there. You fix it when it breaks. Y2K evaluation was a huge cost.
Nosredna
This situation is hardly unique to COBOL. The reason that most large application systems aren't converted to your favorite language is that the cost and risk of doing so is very high, and if the application is mission critical then a risky undertaking is just stupid. Now, one can *automate* the conversion of COBOL to Java. Then it doesn't matter whether you know what it does, as long as the converted code does the same thing. Managers are still rightfully afraid of this, because it is hard to know if the translator is trustworthy.
Ira Baxter
@Ira Baxter: You have legacy code which you cannot specify completely and you consider it a risk to make any changes of any kind. That's the working definition of a liability. Keeping it because it's *risky* to replace it is simply craziness. It's keeping a costly antique around simply because it's a costly antique. If you think it's risky to replace, then you *must* replace it with something that has a known specification and eliminates all risk.
S.Lott
@S.Lott: and the situation with most modern software systems is... that they have known (let alone written) specifications? Give me a break. COBOL applications aren't any worse than the rest of the world statistically. Frankly, they are all terrible. But don't lay that at COBOL's feet.
Ira Baxter
@Ira Baxter: The question was about "Legacy Cobol", not "most modern software systems". I agree with you. But the question was about COBOL, so the answer is about COBOL. To generalize needlessly would be -- frankly -- needless.
S.Lott
@S.Lott: "keeping it around because its risky to replace to replace it is simply craziness". You cast aspersions on COBOL, but your objection isn't COBOL specific. Every piece of software of any size that I know about has this property, but its *your* generalization. Sorry if I seem cranky about this but I think your generalization was inappropriate.
Ira Baxter
@Ira Baxter: I can't understand your complaint. I agree -- much legacy software is bad. Legacy COBOL can be as bad as legacy anything else. The question asked specifically about COBOL, so I answered specifically about COBOL. If you would like to ask another question about legacy code in general or legacy code in other languages, feel free. I tried to answer the question *as asked*. If you think I should have answered a different question, feel free to ask that different question.
S.Lott
+1  A: 

There are a few factors here:

  • Cobol program files are super long and just about always on ultra-secure mainframes. Usually the Java developers don't have access to them.
  • Colleges & Universities haven't taugh Cobol for more than 20 years. As a result, all of the really top-notch Cobol developers have moved up in their companies to be replaced with a bunch of tech school grads. These people didn't love programming enough to be hackers (or they'd do C, Python, C++, whatever and wouldn't have taken a course) or enough to go school (and be Java, .Net, Python, whatever).
  • Java developers generally lose their minds when they look at Cobol programs in their 50,000 line glory, so they aren't any help.
  • There really aren't any documents, and the logic is so tight in these programs that you should really just read them and convert them.
  • Most of these companies are financial companies where the best way to blowup and not be in the industry anymore is to screw something up. Good way to screw something up is to tack something like converting a critical task from Cobol to Java.

It's going to take a long time - every so often, part of one of the programs stops working or can't do something, and it gets replaced. I don't see a lot of senior managers having the stomach for the all of the FUD in one of these projects, and the timeframes are pretty long in terms of return on money spent.

stevedbrown
A: 

Something to realize about old COBOL applications, besides the language dissimilarity, is that at a lot of data structures built in these applications don't conform to any later RDBMS structure, so really you would be talking about rethinking a lot of the underlying architecture and design, not just changing the language syntax, and replacing that would have a lot of performance risk once it hit real world loads, even if it could be QA'd sufficiently.

The bottom line is that it is more economical to bolt on new features in a modern language than rewrite it. As long as that continues to be the case, COBOL will continue to live on.

Yishai
+1  A: 

Cobol has the advantage of being fast for moving data around, which is what that kind of applications tend to do a LOT. Also the machines are designed for I/O, not processing speeds. Hence, any translation to another language will most likely be slower than the Cobol counterpart on identical or similar hardware, leaving no reason to do so.

Let me ask a counter question: WHY convert it, if you have something in place that works?

(Similar to tearing down a bridge ever 10 years just for rebuilding it again right afterwards - it is usually always cheaper just to maintain what you have).

Thorbjørn Ravn Andersen
Why is COBOL faster at moving data around than modern languages? What do is do special to make this happen. And why don't other languages do it?
Nosredna
For what I have understood Cobol has constructs for grouping information together in lumps which can then be treated as a single unit including when reading to/from disk. This lowers the requirements of the cpu, and allow the machine to be constructed with an emphasis for I/O. The first implementations of Java on the IBM midframe architechture were abysmal as they had much too little CPU power.
Thorbjørn Ravn Andersen
You can read a struct as a monolith in C, too. That's not the reason.
Ira Baxter
A: 

COBOL is, in effect, a superb DSL (domain specific language).

It's domain is business rules as embedded in (mainly) backend applications.

Find another language that....

  • is feature rich in that specific domain
  • has some years of actual, applied, experience behind it so all the gotchas are cured or out in the open
  • has a TCO (total cost of ownership) lower than the existing COBOL legacy mountain
  • is cost-effective to convert to

....and you will have the killer application for backend business applications.

Sunanda
COBOL is just another programming language. It has scalar and record declarations. It has assignment, if, and do statements. It has subroutine calls. (It even has OOP features if you are using a modern compiler). That makes it just like C and Java. It is NOT domain specific any more than Java is.
Ira Baxter