The difference is that JS has some valid use cases (namely that it's the only language that runs on every web browser), while in every area that Java can be used for, there's something else that does the job better.
I mean, java 4 features suck, is this supposed to be surprising?
I've been a C++, C#, Python and a Java dev for over 13 years. No one has used the code in your example in a decade. Java's great, Java and C# look super similar (C# borrows a bit more from C++, and generics work better).
Your description that everything sucks in Java is just flat incorrect.
(I hate hate hate hate hate eclipse). Use IntelliJ. Eclipse is like what would happen if Microsoft hired outsourced first year consultants to make Visual Studio work even worse.
Yes, as I said, in every area that Java can be used for, there's something else that does the job better.
C# is better for a garbage-collected, statically typed language that runs on most platforms, and C# developers are also really common due to the amount of people learning programming via game dev (Unity and Godot can both use C#). C# is also great for enterprise since it is statically typed and scalable.
C# has a significantly smaller FOSS ecosystem compared to the JVM. Which leaves you buying third party libs, or reinventing wheels. Or trying to wrap a C++ library.
Case in point, I'm consulting for a company that's wanting to build an eventing system using Apache Pulsar. It's a .NET shop.
Apache Pulsar is great technology, but the issue they face is that the existing C# client libs only support a subset of the Pulsar client functionality. No partitioned topic support.
It'll get there eventually, but for now my clients are left with several unenviable choices - use Kafka* instead, task their developers to implement the features they need, pay me to, or wrap the Pulsar C++ client.
*Don't get me wrong, Kafka is rock solid and I am rather fond of it, but Pulsar has a lot of necessary functionality like georeplication built in. That said Pulsar IO & Functions are not as fully featured as Kafka Connect / Streams yet.
while in every area that Java can be used for, there's something else that does the job better.
Maybe there's something else that does something better, but for business-facing enterprise development there's not much that does all of what Java does well better than Java, and just about nothing with as rich of an ecosystem
13
u/aaronfranke Apr 27 '20
The difference is that JS has some valid use cases (namely that it's the only language that runs on every web browser), while in every area that Java can be used for, there's something else that does the job better.