Hacker News new | ask | show | jobs
by shartacct 1710 days ago
There's no real reason to use java for new development in 2021.
5 comments

Java has a better technology stack. The JVM is light-years ahead of the .NET runtime.
Are you referring to its GCs, compilation tiers, or observability? ;)
Err... Not defending Java, but does .NET support Linux at all?
Yes - .NET 5 and 6 both have runtimes and SDKs available for Mac and Linux. At least in my opinion, Linux is the preferred deployment platform for it now unless you have a specific (usually older) library that only works on Windows.
.NET 5 finally delivered Linux support but only eleven months ago, so I would test it some before betting the farm.
> .NET 5 finally delivered Linux support but only eleven months ago

The previous versions in this stream (.NET Core 2.1, .NET Core 3.0 and 3.1) also run fine on Linux. For web server / API server workloads, it's been stable for a lot longer than 11 months, and people do indeed "bet the farm" or "run the business" on it, quite happily.

Technically, this starts with .NET core 2.1 on 2018-05-30. The prior version, 2.0, released on 2017-08-14, wasn't _quite_ there yet although some people were happy with it for production use.

.NET has been on Linux for years now. And my company is using it in production on Kubernetes (Linux/Debian). Its crazy how dependable and fast it is. Startup times are amazing and its only getting better each year. We're looking to upgrade to .NET 6 in production by January.

Have you even seen the benchmarks compared to Java and other languages?

https://www.techempower.com/benchmarks/#section=data-r20&hw=...

If you're not paying attention to .NET its time to get your head out of the sand, seriously.

I can also confirm that I’ve been using .NET on non Windows OSes for years and it works really well. However the Benchmarks are rigged. The code they wrote for that one benchmark for in the top is a complete cheat. Check out the source and compare it with the other ones from the top 10. .NET is fast but Java is truthfully still faster.
I've been using it exclusively on Linux since 2.0. Both running and developing.
> exclusively on Linux since 2.0.

.NET Core 2.0 (August 2017) we assume.

That was implied. The original NET 2.0 was never available on Linux. Mono used a different versioning scheme IIRC.
.NET Core is main support for Linux for .NET
The question was "at all." .Net has been available on Linux for ~18 years.
Yes, since 5 years (.NET Core 1.0)
Yes. It's ported to every mainstream CPU architecture and OS.
Then use Kotlin, and take advantage of the jvm and the ecosystem, and avoid basically all the stuff you listed about the java language.

"no real reason" is a stupid take. I could list multiple, but a big one is that there are hundred java developers for each dotnet developer in my city. The java env is well tested and well understood, if anything one should argue why not use it instead of a hip and trendy alternative.

Their point about using .NET were not really valid since one of the big and best reason to use Java is that you already have a Java codebase, but things like value types and generics without type erasure aren't solved in Kotlin, so Kotlin isn't really a good answer to his not really valid point.
> things like value types and generics without type erasure aren't solved in Kotlin

Perhaps not solved, but at least partially addressed with value classes[1] and reified type parameters[2].

[1] https://kotlinlang.org/docs/inline-classes.html

[2] https://kotlinlang.org/docs/inline-functions.html#reified-ty...

> take advantage of the jvm

In what way? It's slower and has less features than the .NET runtime.

> "no real reason" is a stupid take. I could list multiple, but a big one is that there are hundred java developers for each dotnet developer in my city. The java env is well tested and well understood, if anything one should argue why not use it instead of a hip and trendy alternative.

So, your only credible excuse for using java is inertia from boomers and middle managers refusing to adapt from the standard of the early and mid 2000s?

> So, your only credible excuse for using java is inertia from boomers and middle managers refusing to adapt from the standard of the early and mid 2000s?

If you come in and freely migrate all of the Java codebases to .NET while maintaining code quality and functionalities, I'm sure many people would let you do it. If you don't understand why people stick to one language, that means that you've never worked on a big codebase, or completly ignore the business side of the developer job. In both cases, that's a lack of wisdom on your part.

I guess you missed the 'new development' part of my original comment? Obviously it would be nonsensical to port a large extant codebase to a new language and tech stack if it's just being maintained.
Here is one real reason to prefer it over .NET Core: https://github.com/dotnet/sdk/issues/6145
why actually? what does it send?
In the past it has sent command line arguments and the path of the current working directory, among other things, according to comments on that issue. Even if Microsoft doesn't intend to deliberately collect sensitive data, they don't seem to think it's worth putting much effort into preventing accidental data leaks from broken anonymization, unreliable opt-out mechanism, etc.
Java is way better than .net, which nobody at all uses outside MS. Certainly not in enterprise.
> Certainly not in enterprise.

Lots of people use .NET in enterprise, I don't know where you got that impression.

There's tons of .net usage in enterprise, what are you talking about?
>Certainly not in enterprise.

pretty odd take, in which country?

yeah, you got it. My city has very little job listings requiring .NET for actual back-ends. Whereas, there are like a thousand Java jobs and almost half mentioning Spring