6 ms·
I used to be .NET dev and don't agree. Couple of reaons: 1) Modern Java is almost as good as C# with some things I can't give up in Java (static imports => suc
by tkubacki 3y ago
I used to be .NET dev and don't agree. Couple of reaons:
1) Modern Java is almost as good as C# with some things I can't give up in Java (static imports => succint code, Groovy Spock => succint tests)
2) Kotlin is better than C#
3) JVM has much much bigger ecosystem (almost all the apache projects are JVM oriented) and default web framework is much less code to type (SpringBoot) is much more productiv
4) JVM has wider variety of langs
For those reasons IMHO if you are small-mid company (or startup) it's wiser to choose JVM.
- hiAndrewQuinn 3y ago#1 => agree #2 => don't know enough about Kotlin to comment #3 => agree but quality > quantity #4 => not terribly important to me (Clojure is cool but it's not "switch to the JVM" level cool)
- pjmlp 3y agoKind of, maybe you need to do some low level coding and don't want to wait for Valhala, or make use of JNI and native libraries, GraalVM/OpenJ9 still aren't as integrated as .NET Native or Native AOT, e.g. writing native shared libraries. Also Java lost the attention span of the gaming industry, besides Android casual games and Minecraft, there are hardly anyone else paying attention to it.
- Ygg2 3y agoTo be fair, C# is ok for game dev, but not great. C# libraries are lagging heavily behind Java. Want a fastest possible library? It's in C++, and not portable to Win/Mac. So good luck with wrap + porting it. Want a decent implementation of an algo? It usually exists for Java but not for C#. Hope you like writing it from scratch. Want a C# implementation of an algo that doesn't allocate to the Nth degree. Again, write it yourself. But ok, maybe Unity has a good ecosystem... And they fucked it over a barrel.
- pjmlp 3y agoIt is widely better recieved in the AAA gaming developer community than Java, and that is what matters. I also like Java, but c'mon no decent algorithms being implemented in C#? That is already approaching zealotry.
- Ygg2 3y agoI didn't say no decent algorithm in C#, but for each performance sensitive algorithm/data structure there is a C and Java implementation at the least ( in my case Roaring Bitmaps). In C# the solution is half baked or archived or abuses allocation. I think Unity has way more with C# adoption in game dev than innate C# qualities.
- neonsunset 3y agoThis is a classic case of goalpost moving. The reason why so many algorithms are written in Java especially closer to academic side is because most curriculums in comp-sci often straight up not allow using anything else except Java, Python or sometimes C++. Having C# as an alternative in these is a luxury. There are also more people using Java in general. However, this does not make it a better language at solving these tasks, nor it is any suitable for writing high performance implementations for advanced vectorized algorithms which would push hardware, which is actually what you want when you start caring about such scenarios, which C# excels at.
- Ygg2 3y agoI'm not moving the goalpost. I explained my examples in another reply. Want to write an engine mostly from scratch in C# and you need libraries that are low on allocation and for niche data/algorithms that games need? You're going to have a bad time(TM). Sure you could use YAML parser, but it allocates everyone and their mother. Can you find a Fluent localization in C#? Sure, but its outdated and archived. Ok, but basic RoaringBitmap implementation? The repo is archived and not fully complete. Why C# is used in game dev is incidental. It has more to do with Unity and XNA/FNA than any concrete quality of language modulo value types (but then again, most C# libraries don't focus on avoiding allocation and are just as happy as Java to construct a complicated hierarchy of classes).
- mpawelski 3y agoJava is surely keeping up but I can't name single Java feature that I miss in C# or is implemented better in Java. I haven't used Java in a long time though, just occasionally I read about new Java features and I've never said to myself "cool, I wish I had it in C#". Static import are also available in C# for quite some time now (c# 6, released in 2015, and in C# 10 you can even make this import global for for project). I haven't used Kotlin, is there any killer feature compared to C#? (except more succinct code in certain cases?)
- pjmlp 3y agoDepending on how you look at it, better extension everything support on Kotlin's case, and a way to do DU, while it keeps being discussed for C#, people should just add F# to their codebase, but alas.
- tkubacki 3y agoKotlin is younger and made better choices by default, like immutable "val" as default option. Also since it's Jetbrains - IDE integration is superior compared to anything C# can have (including Rider...)
- lenkite 3y agoAlso with JDK 21 - you can use virtual threads. No need for async/await which IMHO is a design mistake. Java copied Go here instead of C#.
- metaltyphoon 3y agoWhich makes C interop worse, just like Go
- Const-me 3y agoI think Java is only good for long-running servers. Java doesn’t support C interop. For many desktop and embedded projects this is a showstopper, here’s an example https://github.com/Const-me/Vrmac/tree/master/VrmacVideo https://github.com/Const-me/Vrmac/tree/master/VrmacVideo That C# code directly consumes V4L2 and ASIO Linux kernel APIs, and calls unmanaged user-mode DLLs like libfdk-aac.so and liba52-0.7.4.so. Native stack and value types in C# reduce load on GC, and the number of complicated tricks required from JIT compiler. This in turn helps with startup performance. This is critical for command-line apps, and very desirable for desktop apps. Another thing missing in Java is intrinsics support, both scalar like popcnt, bitscan, BMI, etc., and SIMD like SSE and AVX.
- generichuman 3y agoProjects Panama & Valhalla seems to solve all your complaints: > Java doesn’t support C interop. For many desktop and embedded projects this is a showstopper, here’s an example https://github.com/Const-me/Vrmac/tree/master/VrmacVideo https://github.com/Const-me/Vrmac/tree/master/VrmacVideo That C# code directly consumes V4L2 and ASIO Linux kernel APIs, and calls unmanaged user-mode DLLs like libfdk-aac.so and liba52-0.7.4.so. Part of Panama: check out the "Foreign Function & Memory API" [0]. The official docs [1] say it is a preview in 21 but it got stabilized in Java 22 (isn't out yet). > Another thing missing in Java is intrinsics support, both scalar like popcnt, bitscan, BMI, etc., and SIMD like SSE and AVX. Also part of Panama: see the "Vector API" JEP [2]. > Native stack and value types in C# reduce load on GC, and the number of complicated tricks required from JIT compiler. This in turn helps with startup performance. This is critical for command-line apps, and very desirable for desktop apps. This is part of Project Valhalla [3], they're adding value types and actual generics, among other things. That said, most of these are not done / not in a stable LTS Java release yet. We'll see how much better it'll be compared to C# (if at all) once they land. [0] https://openjdk.org/jeps/454 https://openjdk.org/jeps/454 [1] https://docs.oracle.com/en/java/javase/21/core/foreign-function-and-memory-api.html https://docs.oracle.com/en/java/javase/21/core/foreign-funct... [2] https://openjdk.org/jeps/460 https://openjdk.org/jeps/460 [3] https://openjdk.org/projects/valhalla/ https://openjdk.org/projects/valhalla/
- 3y ago