Essential insights from Hacker News discussions

Growing the Java Language [video]

Here's a summary of the themes from the Hacker News discussion, with direct quotes:

Java's Continued Relevance and Modernization Efforts

The discussion begins with a question about returning to Java for startups, highlighting that while some might consider it an older choice, there are significant modernizations and productive frameworks making it a viable option again. This sentiment is echoed by users finding success with specific Java-based technologies.

  • "Quarkus and Vaadin is pretty productive." - winrid
  • "The vast majority of people don't pay anything for Vaadin as it's Apache 2 licensed." - fredu81
  • "High performance Java is awesome and can be competitive with C++ and Rust for non trivial systems, thanks to much better development cycle, debugging and high quality libraries." - gorset
  • "Java gets a lot of flack in these parts, mostly by people who don't use Java and pull opinions out of their arse, but you'd be hard pressed watching both talks and not being impressed by the effort that's going into continuously improving the language." - elric

Concerns about Specific Frameworks and Corporate Stewardship

A notable concern raised is the stewardship of established Java frameworks, particularly worrying about changes brought about by acquisitions. Broadcom's discontinuation of Bitnami images is cited as an example of potential instability.

  • "I'm concerned about Spring Framework shenanigans. It's under Broadcom now, which feels like a dangerous steward. Just few weeks ago Broadcom discontinued newly acquired bitnami images." - vbezhenar
  • "It's hard to imagine Java without Spring, everyone uses Spring." - vbezhenar

The Divisive Nature of Checked Exceptions

The most extensive theme revolves around Java's checked exceptions. While some defend them as a mechanism for explicit error handling and type checking, many others find them cumbersome, verbose, and outdated compared to error handling in modern languages. The lack of modern syntactic sugar for handling them is a recurring point of frustration.

  • "Getting rid of checked exceptions would be very beneficial for Java's popularity. No modern JVM language has kept that annoying feature." - seunosewa
  • "The actual problem is that handling exceptions in Java is obnoxious and verbose. I cannot stress enough how bad it feels going from Zig back to Java, error-handling wise." - Defletter
  • "A hot take I have is that Java's checked exceptions - which everyone hates - are semantically very similar to Rust's Result and ? error handling - which is broadly liked. The syntax makes or breaks the feature." - xmodem
  • "What is the problem with Checked Exceptions? Don't they just provide type checking? I would think that developers would want to know which function might or might not execute a non-local goto in middle of execution and handle that properly, since debugging that will be a mess." - HexDecOctBin
  • "Part of it is an ecosystem thing. It's a lot better now, but there were times when libraries would throw a variety of checked exceptions that usually couldn't be handled sensibly other than by being caught and logged by your top-level exception handler." - xmodem
  • "But yeah sure, if Java somehow provided a standard interface & an associated operator like Rust's Try trait to handle checked exception, it would probably have a much better reputation than it has now." - lock1
  • "It's quite weird the direction Java, C#, Javascript communities take on this. Lots of people just go with unchecked or using nullable reference. Which is fine for a throwaway program, but quite painful in a larger project." - lock1
  • "In practice there are problems: Everything can throw IOException technically which you need to handle. There are non checked exception anyway, so there might be exception that are thrown anyway. It's a mess and there is a reason no other mainstream language uses them, even if Java people don't like that fact." - ahoka
  • "But other, even more common source of hate is that people simply do not want to handle them. They prefer if they can kind of pretend that stuff does not exists and look like '10x fast developers'." - watwut
  • "All Java needs is better syntax to handle exceptions. Nobody wants to open a whole block to handle an expected exception." - DarkNova6
  • "I disagree entirely, but I'd love to hear your arguments (other than vague allusions to "popularity" and other languages). Improved checked exception handling in Streams would be nice, but that's my only gripe with them. They force you to stop and think, which is a good thing." - elric
  • "There should be a middle ground where the IDE could generate your exceptions for you based on unchecked exceptions. Dunno what to call that but dealing with checked exceptions in the IDE is so much easier than manually reading docs for runtimes." - smrtinsert
  • "I would like some sort of pragma that would allow me to ignore all checked exceptions in a file. Something like 'use nocheck;' and then all methods would implicitly throw Exception." - forinti

The Rise of Kotlin and its Relationship with Java

Kotlin is presented as a strong contender and often a "better Java," praised for its productivity and seamless integration with the Java ecosystem. However, some users express reservations about its readability and potential future lock-in, contrasting it with Java's ongoing feature development and broader community governance.

  • "Kotlin is a much better Java so that's what we use :)" - augustl
  • "Given how locked-in Kotlin is to a single company, I kind of get his skepticism." - augustl
  • "After several years of using Kotlin, I’ve learned that while it’s easy and often a pleasure to write, it can be a nightmare to read and I spend far more time reading code than writing it." - p2detar
  • "At this point Kotlin is arguably a better language to use with any of the popular Java frameworks. I'm not really aware of any exceptions to this." - jillesvangurp
  • "It was designed as a drop in replacement. It's why it caught on with Android developers before it even was released." - jillesvangurp

Nuances of Language Governance and Community Influence

The discussion touches upon the nature of language control, with Java's governance by Oracle being debated. While Oracle holds significant influence through employment and leadership, the development process is described as community-based and meritocratic, with other entities also contributing.

  • "Java is controlled by Oracle." - jillesvangurp
  • "That's factually incorrect. Oracle owns the trademarks, but the language proper is governed by the community, most development is done in the open as part of OpenJDK, which is the reference implementation." - elric
  • "Oracle employs most of the contributors and the OpenJDK leadership is Oracle as well. But it's true that companies like IBM/Red Hat (mainly) and a few others contribute as well and that decision making is community based. In practice, Oracle still wields a lot of influence over the roadmap and technical direction." - jillesvangurp

The "Magic" of Modern Frameworks vs. Explicitness

A counterpoint to the desire for modern, concise syntax (like Kotlin's or potential Java improvements) is the appreciation for explicitness. Some developers find highly "magical" frameworks, which abstract away underlying details through extensive annotations, to be uncomfortable and prefer clarity.

  • "Quarkus is just a little too much like magic for me. Too many annotations hides what's going on underneath, which makes me feel a bit uncomfortable. But I'll accept that's probably just me." - kitd
  • "Vertx on the other hand, which it is built on and which itself builds on Netty, is excellent, and very performant for typical backend services. It now has support for virtual threads too." - kitd