Derek wrote:Xenomortis wrote:Tub wrote:So far, every language I met had *some* use case where it shines, and *some* use case where it's a poor choice.
What was Java's "shining" example?
*runs*
The standard library is god tier. No other language even compares to it.
Absolutely agree with you on this one. I think a lot of the flak Java gets (verbosity, performance, etc.) is based on really out-of-date information—like, from the 90's. For the most part, Java is surprisingly good for the amount of hate it gets.
There are really only two things that I really dislike about java: Boilerplate and Type Erasure.
The amount of boilerplate code required to implement common patterns (this is a different type of verbosity from what most people complain about, I think). For example, making a POJO that properly implements equality and hashing requires a lot of boilerplate, and while IDEs can generate this code for you, it's hard to see at a glance whether or not the boilerplate has been modified from the default, which makes it hard to debug and reason about.
As for Type Erasure, I know why they did it, and there are plenty of ways to work around it, but for every major project I work on, there are invariably a few unavoidable unsafe casts that work their way in there, and that bugs me on principle.
Fortunately, Kotlin does a lot to mitigate these issues, while keeping the strengths of Java (the JVM, the awesome standard library, to name a few). I love that I can use Kotlin with existing projects and it interoperates seamlessly, and I love that it eliminates a lot of boilerplate (especially for defining POJO classes). I have a few minor gripes with it (as with any language) but I have found in practice that I am able to produce working production-quality code much, much more quickly (3x to 4x more quickly) working in Kotlin. Partly because the language is awesome and it has the Java library available, but also because the language integration with the IDE (I use IntelliJ IDEA) is among the best I've ever seen.
I rarely have "favorite" when it comes to programming languages (as has been said, it's largely a matter of taste), but in a very concrete sense, the switch to Kotlin has vastly improved my team's productivity and vastly reduced crashes in production code (and development code—I think in the last 4 months, we've seen only a single NPE even in development! The compiler catches SO MUCH more than the Java compiler...)