You are viewing a single thread.
View all comments View context
27 points

Non programmer but skilled with computers type guy here: what makes Java well suited for this?

This is probably an incorrect prejudice of mine, but I always thought those old languages are simpler and thus faster. Didn’t people used to rip on Java for being inefficient and too abstracted?

Last language I had any experience with was C++ in high school programming class in the early 2000s, so I’m very ignorant of anything modern.

permalink
report
parent
reply
33 points

Java can be pretty damn efficient for long running processes because it optimizes at runtime. It also can use new hardware features (like cpu instructions) without having to compile for specific platforms so in practice it gets a boost there. Honestly, the worst thing about Java is the weird corporate ecosystem that produces factoryfactory and other overengineered esoteric weirdness. It can also do FFI with anything that can bind via c ABI so if some part of the program needed some hand optimized code like something from BLAS it could be done that way.

All that to say it doesn’t matter what language they use anyway, because rewriting from scratch with a short timeline is an insane thing to do that never works.

permalink
report
parent
reply
15 points

Why is there a need to rewrite it at all? Is it because COBOL is basically ancient hieroglyphics to modern programmers thus making it hard to maintain or update?

permalink
report
parent
reply
28 points

They want to make buttloads of money from a rewrite, and it would cost buttloads to do this. They probably also want things to run like shit and cause misery for retired Americans.

permalink
report
parent
reply
14 points

Refactoring a code base is kinda like general maintenance for the application. Over time deprecated features, temp fixes, etc. start to be a lot of the code base. By cleaning things up you can make it more maintainable, efficient, etc.

That being said, for systems this large you usually fix up parts of it and iterate over time. Trying to do the whole code base is hard cause it’s like replacing the engine while the car is in motion.

permalink
report
parent
reply
6 points

I wouldn’t necessarily agree it needs to be rewritten. Hiring programmers that are willing to work in cobol would certainly be harder than other languages though, because you’ll have a much smaller candidate pool and people would be unlikely to see learning cobol as a good career investment

permalink
report
parent
reply
2 points

COBOL code, like any code, was written to embody certain business processes, and also to work around the quirks and blind spots of COBOL. And the people who understood those business processes are likely to be dead by now, and any documentation they wrote might be current and correct, or it might not. And very few people under the age of 60 have ever used COBOL in anger. So any legacy replacement project is going to have to encompass a big reverse-engineering effort, including analysis of a code base nobody is familiar with.

I’m old. A friend of mine is a fair bit older, getting into his late 70s. He knows COBOL but his main area of expertise is OS services, database tuning and assembler on old IBM and Fujitsu iron. Those are critical to keeping those old systems running well. He works half-time, is booked over a year out, and has a jaw-dropping daily rate. He also has a rider: one provision is that they have to tell him where he can smoke on-site, and if the answer is “nowhere,” the deal is off. Also, he won’t schedule any work that conficts with Burning Man, and he looks like a homeless guy. I brought him in on a consulting gig once. He did his bit, including an amazingly effective presentation to the C-levels (despite his profoundly non-executive appearance), and went his merry way. Saved us a fortune. You need people like that in order to have even a remote chance of success, and they’re becoming exceedingly rare. Musk and his kiddies don’t even know what they don’t know.

permalink
report
parent
reply
1 point
*

Yeah, Java can run maybe half as fast as equivalently complex C, while being far more maintainable. But to see that kind of performance, you’ll want to use POJOs (plain old Java objects), not that enterprise bullshit. And there are many other optimization techniques that your average Java coder wouldn’t see in their average coding job. I’ve been there, didn’t like it. If I’m going to be dropping down to C for the hot spots, I’d rather use Python.

All that to say it doesn’t matter what language they use anyway, because rewriting from scratch with a short timeline is an insane thing to do that never works.

Schedule-driven development by people with no domain knowledge, with poorly understood requirements and life-and-limb-critical outcomes, led by an unpredictable moron. What could go wrong?

permalink
report
parent
reply
1 point

I wouldn’t assume that Java is only half as fast as C for every workload. It’s probably a lot closer than you think in a lot of real world scenarios.

permalink
report
parent
reply
12 points

The way Java is practically written, most of the overhead (read: inefficient slowdown) happens on load time, rather than in the middle of execution. The amount of speedup in hardware since the early 2000s has also definitely made programmers less worried about smaller inefficiencies.

Languages like Python or JavaScript have a lot more overhead while they’re running, and are less well-suited to running a server that needs to respond quickly, but certainly can do the job well enough, if a bit worse compared to something like Java/C++/Rust. I suspect this is basically what they meant by Java being well-suited.

permalink
report
parent
reply
2 points

Java can be fast at runtime, but optimization is most effective on frequently-run, repetitive sections of code.

The slow Java interpreter spin-up time was a big annoyance for use of Java in serverless cloud functions. Now the big cloud providers have ways to minimize that spin-up delay.

permalink
report
parent
reply
11 points

I am a programmer but I’m not sure why people think Java is suited for anything, especially a system so sensitive to bugs. It’s so hard to write high quality readable code in Java. Everything is way more clunky, and verbose than it needs to be.

Some major improvements were made with versions 17+ but still, it feels like walking through mud.

It’s a language from the 1990s for the 1990s.

Btw the performance is actually pretty good in Java, the old reputation for slowness is entirely undeserved today.

permalink
report
parent
reply
7 points

It’s a verbose language but I don’t know if there’s any real language that encourages highly readable code beyond low-level syntax. You want to create a God-class in Python with nonsensical variables and 5 levels of nesting? The language won’t stop you.

permalink
report
parent
reply
4 points

If it has to be JVM, then Kotlin. Java done properly.

permalink
report
parent
reply
1 point

I wish Java was declared deprecated back in 2017 when Kotlin was adopted for Android and supported by Spring. It was the only sensible way forward for JVM. Sure with containerization there’s some debate for the necessity of JVM at all but its GC and runtime optimizations are nice.

permalink
report
parent
reply
2 points

Anecdotally, Python is about three times as concise as Java. You have to write lots of boilerplate to do anything much more complex than Hello World in Java. And one of the oldest and most reproducible results in software engineering is that the defect rate is proportional to the number of lines of executable code. The more concise the language, the cheaper it is to maintain. This has been measured in hundreds of environments, with dozens of languages, over decades.

Python is slow, though, so there are some situations where it’s not a good choice. But those cases are probably less numerous than you might assume. There have been a few occasions where I was told Python would be too slow, I’ve then built a proof-of-concept, and it was more than fast enough. People suck at knowing where bottlenecks are in complex systems.

And now that the Python project has finally bitten the bullet and taken measures to allow removal of the GIL, things might improve considerably, though Python’s dynamic nature and some features of its type inference mean that some things it does will never be ultra-speedy.

permalink
report
parent
reply
3 points

Other than hardware issues, which someone else mentioned, it has a lot of enterprise-grade functionality that make it more secure and auditable than a lot of other languages. And despite, or maybe because of, its large memory footprint it’s actually faster than most languages.

I totally get any hate about writing Java though. It is a verbose language. Using Kotlin instead helps with that.

permalink
report
parent
reply
1 point

I always thought those old languages are simpler and thus faster

They’re neither necessarily simpler nor faster.

COBOL is simple, but outside its sweet spot, it can’t do much. That sweet spot is high volumes of relatively trivial calculations, coded by non-superstar coders. It’s moderately efficient because it doesn’t do all that much.

Of the oldest languages still in use, FORTRAN has gone through a few generations of incremental improvements, and for complex mathematical calculations, it can be faster than shit off a hot shovel. But again, it’s limited in scope, its data typing is lousy, its general-purpose programming capabilities are poor, and any integration you do with other systems is going to be a vision of hell. I still deal with a FORTRAN codebase on my job, there are some situations where it’s still one of the least-bad options.

Then, the last of the surviving languages of that vintage is Lisp. It can be insanely fast, but despite its simple syntax and semantics, nobody would call Lisp programming simple. Accounting-system coders would recoil in horror.

permalink
report
parent
reply

Technology

!technology@lemmy.world

Create post

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


Community stats

  • 18K

    Monthly active users

  • 8.9K

    Posts

  • 228K

    Comments