r/learnjava • u/kres0345 • Jun 21 '21
Why learn Java when there's C#?
I am genuinely curious, as it seems C# has superseded Java in many regards. The only reason I can think of using Java is backward compatibility.
EDIT: To clarify, the main selling point of Java was cross-platform, but nowadays most frameworks and toolsets are to some degree cross-platform, including .NET Core, which is the new main framework of C#.
0
Upvotes
4
u/berry120 Jun 21 '21
Some good takes already, but here's another:
A decade or so ago, I'd have agreed with you. But C# has, IMHO, fallen to the same trap as C++. It's a decent enough language, but near unbounded feature expansion over many, many years has led to very few people understanding the language in its entirety - most people only ever use a subset of it. That creates technical problems with non obvious behaviour, and business problems with hiring people that understand the specific parts of C# that you happen to be actively using.
For better or worse, Java has been much, much slower on the uptake of new language features - it's only seen real significant changes in two versions, perhaps 3. While that's been frustrating at times, and means we lose some of the nice syntactic sugar of C#, it also means most senior Java devs can near enough fully understand the language. That means, on balance, there's fewer gotchas, and it's easier to hire decent people with a good experience of the language.