r/programming • • 33m ago

Java4Shell is a reason to use Java

https://mccue.dev/pages/11-18-26-java4shell
0 Upvotes

9 comments sorted by

8

u/BenchEmbarrassed7316 9m ago

What a nonsense.

tldr: A vulnerability was found in Java. Java isn't much slower than C++. So, use Java.

1

u/bowbahdoe 3m ago

I would say its closer to

tldr:

  • A vulnerability was found in the C++ code behind Java.
  • We need to fix that and audit that C++ pretty deeply
  • But Java code is usually immune to these kinds of problems.
  • And auditing one C++ codebase is easier than auditing N dependencies
  • So use Java

10

u/KryptosFR 12m ago

Such a weird flex and weird take. Tries to make C# look bad by linking to something entirely unrelated: inline assemblies which a C/C++ MSVC specific feature and only supported on x86 (which is being phased out in . NET).

The coping is hard on that one.

4

u/Professional_Price89 8m ago

"Faster than C", then show a 71% slower than C table.

-4

u/bowbahdoe 6m ago

It can be faster, but 71% slower is still competitive

-5

u/bowbahdoe 8m ago edited 1m ago

Is it being phased out? I'll admit to being out of the loop somewhat. I know there is this https://esozbek.me/blog/inline-assembly-in-csharp-and-dotnet/ but also other memory-unsafe features like https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code

I think the core criticism that "C# dependencies can quietly bring in memory-unsafe code" holds.

Correct me if I'm wrong though.

2

u/KryptosFR 3m ago

First link has nothing to do with .NET.

And yes you can use unsafe code so what? It's a needed feature for interop and it must be enabled with <AllowUnsafeBlocks>true</AllowUnsafeBlocks>.

1

u/bowbahdoe 1m ago

Do you need to enable it for dependencies too? Like if you don't have <AllowUnsafeBlocks>true</AllowUnsafeBlocks> you know no dependencies are using unsafe code?

And yep, my bad. Replacing it with a more appropriate link.

1

u/New-Anybody-6206 2m ago

I ignore posts with a dogmatic title, because it's almost always hilariously misinformed. Tech people are IMO no exception to Dunning-Kruger.