AI migrated legacy COBOL programs to Java, bugs included
61–70 of 108 posts
Re: AI migrated legacy COBOL programs to Java, bugs included
#62Earlier quoted context omitted.
You can't use BigDecimal either. There are libraries whose whole purpose is just to exactly reproduce COBOL arithmetic, eg. the IBM Decimal Arithmetic Library.
Wow, their Java code example [0] makes COBOL look elegant and terse by comparison. [0] https://community.ibm.com/community/user/blogs/gregory-cerne...
Yes, you can't tell at a glance if `+` really still does what it should, but I find that problem no different from a library mis-naming a function and/or said function having strange side-effects.
`+` should do addition, period. No, not even concatenation if possible (I do find the lack of a separate concatenation operator to be a language flaw --- that said, I understand the use of `+` for concat in libraries targeting languages that offer no alternative).
I think the abuse (especially in C++ ... seriously, allowing overloading of the comma operator? --- and working via bit-shifting streams by ${some_string} bits) gave everyone a bad taste and they kind of threw out the baby with the bathwater.
Re: AI migrated legacy COBOL programs to Java, bugs included
#63Earlier quoted context omitted.
sometimes if the bug exists for enough time it is intended behavior
One of the hinges on our front screen door was coming off, the screws were coming loose from the wooden door jam. So I screwed it back on. My wife and son then told me I "broke" the front door. I was confused, I thought I had fixed it Turns out, with the door coming off the hinges, it wasn't closing properly, which meant it was ajar most of the time, so our dog could push it open with her body. Now I'd fixed it, it c…
Re: AI migrated legacy COBOL programs to Java, bugs included
#64Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.
"Now, no one does." well, we just need to learn the rewrite then ???
Re: AI migrated legacy COBOL programs to Java, bugs included
#65Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.
> Now, no one does. I got a chuckle over this, but in my experience working on legacy systems, this is the case already. Using AI to translate/explain the code brings extra understanding.
More like it will hallucinate some explanation & cause even more confusion.
Re: AI migrated legacy COBOL programs to Java, bugs included
#66Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.
Having worked in COBOL extensivly in the 80s and 90s, as well as working for a software house that did migrations (Craziest was Plan assembler to Dec Vax C). I do wonder how an ambitious AI would handle the maths. COBOL is renowed for its fixed no rounding maths, utterly rigid and defined in the code, Java on the other hand is not (e.g., 0.1 + 0.2 becomes 0.30000000000000004), unless they are extensivly using BigDeci…
Your 0.1 + 0.2 example wasn't an issue than and is not an issue today.
Re: AI migrated legacy COBOL programs to Java, bugs included
#67Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.
"Now, no one does." well, we just need to learn the rewrite then ???
The guy who no longer works at the company knew it was because of a bug in the DB that wasn't fixed by the vendor after the company cancelled the maintenance contract due to financial difficulties during the great recession.
AI doesn't and can't know that. So AI proposes to "fix the bug as we port it" and remove the double INSERT. The CTO sends an email saying that the new AI fixed 174 bugs during the porting process and now the company has a much better and resilient system.
BREAKING NEWS: thousands of travelers can't get go back home after thanksgiving due to a computer glitch that accidentally cancelled their return tickets. Stay tuned to our live coverage!
Re: AI migrated legacy COBOL programs to Java, bugs included
#68Before, only the senior cobol programmers at the company understood and knew the codebase. Now, no one does. I can see the allure of moving away from a legacy cobol system. But an AI rewrite doesn't actually solve any of the issues with having a legacy cobol codebase. You just have a new system no one knows or understands.
Prompt the core architecutre well suited for it.
Let it write tests.
Let it vibe migrate from left to write.
Now you at least have a chance of a team being able to work on that code base and actually clean it up and make it good.
Cobold is hard, hard legacy with bad tooling.
Re: AI migrated legacy COBOL programs to Java, bugs included
#69The biggest problem is not that bugs are migrated with COBOL, but that lots of new bugs are going to be introduced. AI is not deterministic, it will be making tons of mistakes. The only realistic low-error approach is incremental step-by-step migration using Cursor or similar tools. However, it requires much more time as each step must be prompted, tested and committed manually. Any hope that one-shot migraton of a l…
Re: AI migrated legacy COBOL programs to Java, bugs included
#70Earlier quoted context omitted.
"Now, no one does." well, we just need to learn the rewrite then ???
The problem isn't as much understanding what the code does (that's hard but not impossible), but understanding why that duplicate INSERT into the database is needed. The guy who no longer works at the company knew it was because of a bug in the DB that wasn't fixed by the vendor after the company cancelled the maintenance contract due to financial difficulties during the great recession. AI doesn't and can't know tha…