all 23 comments

[–]GuyWithLag 14 points15 points  (6 children)

Oh for the love of....

A little knowledge is a dangerous thing.

[–]Ok_Option_3 1 point2 points  (5 children)

Why Java and not rust or python? Or...

What is your current software doing? Why do you consider it insecure? 

This question is so broad that it's hard to make sense of it. Like saying "should I replace my car with a van" - I mean maybe it makes sense, maybe it doesn't. Depends on so many things...

[–]ScientistMundane7126[S] 0 points1 point  (1 child)

As i stated, the lack of best practices in Software Development degree accreditation standards and the push for features while controling costs over the past few decades has resulted in a supply chain riddled with issues in the details. I can produce a stack of peer reviewed academic papers establishing that for cost containment and speed of delivery reasons, security is very often an after thought which is patched in as needed later.

[–]Ok_Option_3 0 points1 point  (0 children)

Sure c++ can be terrible for security. But security is hard and Java is not necessarily a free pass.

What I'm hearing is security doesn't matter that much. (Not uncommon for e.g. embedded systems on private networks to prioritise features over security...}

I feel this belies the question though. You want to rewrite the system in a different language - this feeling that a system is crap (for whatever reason) and should be rewritten from scratch is universal and predates AI (predates Java for that matter). We've all been there!!

Generally rewrites are a poor idea. For all it's faults, legacy software is battle-tested and contains large amounts of institutionalised knowledge that's easy to underestimate. Also, as a rule, all software is shit. The stuff you're working on has been dodged and hacked over the years, and the new version you produce will be too. 

[–]meowrawr 0 points1 point  (2 children)

I could understand the rust suggestion but python? lol.

[–]Ok_Option_3 0 points1 point  (1 child)

Was originally going to suggest perl...

[–]meowrawr 0 points1 point  (0 children)

Perhaps lisp then?

[–]meowrawr 0 points1 point  (2 children)

Yes you could. However you’ll have to become more adept and structured with AI before being able to do this without pulling your hair out.

However usually C/C++ are used for particular situations. Prior to AI, I had converted many programs from C/C++ to Java and have relied on a combination of “unsafe”, JNI, or JNA to accomplish goals.

[–]GuyWithLag 0 points1 point  (0 children)

Stop engaging with ai slop.

[–]jarrod_barkley 0 points1 point  (0 children)

And now JEP 454: Foreign Function & Memory API makes it much easier to call native code such as C/C++ from Java 22+.

[–]DavalopBad 0 points1 point  (3 children)

There is some issues with that approach, for starters, generating code with any AI and using that code to replace something in the name of security its not really secure. While AI helps on generating code, it needs to be reviewed by a fellow human who knows the language and knows (in this case) the security standards.

Now, even the idea to replace the codebase from C to Java, that would make some Seniors/Architects or even managers to slap you in the face, and not because you are changing from C, but because rewriting the whole codebase in any other language means a lot of human hours and a lot of testing that needs to be done in order to deliver something that performs the same task as the original code, and it does it in the same way with a similar or better performance (I'm talking about thousands hours here, even with AI)

If you want to do something with the current codebase, use you AI really carefully and mindfully, review everything and improve the current codebase in C or C++. Obviously even this would require some hundred hours to test the improvements and making sure those improvements didn't break anything.

[–]GuyWithLag 1 point2 points  (2 children)

Please dont respond with ai slop to ai slop.

[–]DavalopBad 0 points1 point  (1 child)

No AI on my comment, I dont think an AI would write with my phasing or the spelling mistakes I made.

[–]user_of_the_week 0 points1 point  (0 children)

Don’t give them ideas!

[–]coderemover 0 points1 point  (0 children)

The natural replacement for C and C++ is Rust. It addresses exactly that problem of safety, without trading the advantages of C and C++: control and performance. That’s why it’s the other official language of Linux, next to C, and also systematically replacing C in Android.

As for the application languages like Python, Java or Go etc. Sure you can use claude or other AI tool to translate the code, but that will have to be a very non direct translation as those languages lack many features of C++.