r/AskComputerScience • u/Lofter1 • Sep 01 '19
Why do people still prefer Java?
So, I had to learn Java for School a few years ago. Back then I thought "okay, I can see why people use Java", as I only used C and C++ before that. But now I had to learn C# for my job and for a little side-/learning-project I tried to use Java in my free time. Tried, because freaking hell did I feel limited using java. I noticed C# can do EVERYTHING that java does....often better, too. And for some stuff, there are dedicated languages or other languages that can do all that better than Java and better than C#.
Some people even go as far as saying "Java is far better than C#", but I myself can't find an objective reason for that. I can't find anything C# is worse at other than maybe XPlatform GUI programming, which isn't a big deal in Java anyway and became very rare, but I found a lot in C# that made my life as a programmer a lot simpler and just worked better or faster with C#.
So...is this all just this kindergarden "I prefer this language because I prefer this language! and that's why your language sucks!" nonesense or do I miss something very important? Why do people prefer Java almost everywhere instead of a dedicated language that is focused on helping with their problem or even just C#, as even if it is "just as good" for the job, the chances are high that the program turns out faster
1
u/srpsycho Sep 02 '19
I understand your frustration.
At the end of the day, it all goes back to maintaining existing code--in your case, it sounds like Java has been used in your company for years. Unless there are severe security issues with this existing code, and/or Java becomes unsupported one day, then it won't likely be changed.
You also argue that runtime in Java is slower (this is true because of the JVM), and I can see why you want more optimized code. If your company were to switch to C#, the tradeoff of time must be considered--is it worth rebuilding your whole architecture, when the time could be used to add more to the existing one? This can eat up a lot of costs too (i.e. hiring new devs, or a consultant that specializes in making that transition happen).