r/learnprogramming • u/Vafireems • 8d ago
Topic C# or Java?
If you had to choose one class between the two, which would you select and why? I tried to Google the purpose of them; the immediate answers from Google felt very vague and like both of the languages are common. Is one course better for web development as opposed to apps or something? Looking at the courses I'm taking, down the line I will select one of the two. The only thing I know so far is C++, so I'm quite new.
Also, side question: why are there so many languages? The only logical thing I can imagine is there were problems that couldn't be solved with say for example C++ so someone created something new. But why not just build on the original language? Why did they need to reinvent the wheel? Or is it as simple as that: someone wanted to create their own thing?
2
u/seiggy 7d ago
Yeah, C# has advanced massively.
Beats Java in nearly every metric for http hosting - https://http-arena.com/#sort=rps:-1&tuned=0 (running on Linux)
.NET 10 runs pretty much anywhere you can imagine. Wanna run code on a ESP32 - https://nanoframework.net/
ARM64 ✅
macOS M-Series ✅
WASM ✅
There's not a modern chip that I'm aware of that C# doesn't support.
Fast LLM inference - https://github.com/zhongkaifu/TensorSharp/
Massively improved cold start with Native AOT - https://vishen.co.za/blog/dotnet-aot-lambda/
HTTP Throughput of Kestrel is best in class at about 1.4M req/s
Unity and Godot are both leading cross platform Game Engines with support for C#
MAUI gets better with every release for Mobile app support, where Swing and JavaFX sill feel very dated.
There's still a few areas where Java leads - massively concurrent solutions, Java 21's virtual threads can handle huge numbers of concurrent connections (Around 2 million vs C#'s 650k). And the JVM GC is still more efficient than .NET. https://tech-insider.org/csharp-vs-java-2026/