DEV Community

Discussion on: Role of Java in modern web development

 
siy profile image
Sergiy Yevtushenko
  • Agree, sometimes conciseness is convenient. But this type of conciseness is available in Java as well.

  • It's not about over-engineering, but rather loss of information. There is often a need to refer to declaration to clarify types, for example. This creates constant "go to declaration and back" navigation noise during reading Kotlin code written by other devs. I've observed this noise even with seasoned Kotlin devs.

  • Extension methods are not replacement to utility methods and Utility classes because they cover only tiny subset of possible use cases. In many cases extensions methods are attached to particular class just because so happened that they have first parameter of this class type.

  • var/val are not matter of taste, it's a real problem. Any editor (person, not software) or UX expert will point on this pair as a potential source of user mistakes.

  • Yes, multiple classes are possible, but only one public class is allowed. And, frankly, I never saw any real use case in enterprise apps code.

  • Under "DSL-ised" I did mean code written with infix functions.

  • Ktor claims nave nothing to do with everyday enterprise reality. Selection of any technology (even version of technology) in big companies are often based on risk assessment. Immature technologies like coroutines or fibers or Kotlin version 1.40-RC are of high risk and avoided at any cost.

  • Optional easily can provide perfectly fine level of comfort except without drawbacks of optional chaining (i.e. lack of composability). As an additional benefit, "monadic mindset" (aka "do when/if value available") has much wider application than optional chaining. For example, it allows writing asynchronous code indistinguishable from synchronous.

Taking into account that Kotlin didn't yet provide any sensible advantages over Java for enterprise environment, I see no reasons to wide adoption of Kotlin in this environment.

Thread Thread
 
alxgrk profile image
Alexander Girke

To make it short: I totally see most of your points, you convinced me that Kotlin has yet a long way to go before being ready for enterprise environments. Hence, only time will show, whether Jetbrains manages to reach their (assumed) goal of replacing Java or not.