Live data from Hacker News

Ask HN: Using Java for a web application in 2023

news.ycombinator.com

11–20 of 69 posts

Re: Ask HN: Using Java for a web application in 2023

#14

Java web applications I’d describe as “boring technology” if you want typical rest applications with SPA frontend or a full stack server side rendered (SSR) app. By boring I mean it works with little fuss or churn. Depending on your scale/budget they’re a bit more expensive to host due to JVM memory requirements but performance is good. Not a Java issue but a issue if you choose a language other than JavaScript for t…

For web apps, why use two languages if you can get away with only one? unfortunately, is hard to beat JS/TS here.

Re: Ask HN: Using Java for a web application in 2023

#15
I highly recommend either Grails, Spring Boot or Micronaut. There are several others, but they lack documentation, has confusing documentation or is over-engineered. Of these 3, Grails is convention over configuration, and the two others configuration over convention. Micronaut is the most performant and use least memory.

Grails has GSP templates, while Spring Boot and Micronaut supports several, but I prefer either Thymeleaf or JTE templates.

Grails and Spring uses Hibernate, which is fantastic to work with. Micronaut has its own orm, which is really fast. In Grails Hibernate is abstracted into something named GORM, Spring Boot's Hibernate abstraction is named Spring Data. Spring Data is more polished than GORM. They're both very well documented and easy to use.

They are all very easy to use with other excellent Java tools/libraries, Kafka, Pulsar, Neo4j and so on.

If time to market is your thing, pick Grails. (This is what I care most about)

If performance (web scale) is your thing, pick Micronaut.

If best documented is most important, pick Spring Boot.

Grails is an abstraction of Spring Boot, basically you can do everything Spring Boot can. But Grails makes Spring Boot a lot easier, especially for inexperienced developers.

Re: Ask HN: Using Java for a web application in 2023

#17
post #14

Java web applications I’d describe as “boring technology” if you want typical rest applications with SPA frontend or a full stack server side rendered (SSR) app. By boring I mean it works with little fuss or churn. Depending on your scale/budget they’re a bit more expensive to host due to JVM memory requirements but performance is good. Not a Java issue but a issue if you choose a language other than JavaScript for t…

For web apps, why use two languages if you can get away with only one? unfortunately, is hard to beat JS/TS here.

If you're a one man show, I think it's a fair argument.

With more people working on it, like typical companies, it doesn't hold a ton of water. Every language has its place to where it's best suited. You can get a more performant, better structured, and safer backend in other languages.

Re: Ask HN: Using Java for a web application in 2023

#18
The JVM is very robust and the language has improved considerably if your prior experience was a while ago. By now there are robust libraries for most things, IDE support, etc. but you’ll find odd gaps around packaging, formatters, etc. because there are so many entrenched groups with different goals who haven’t coalesced on common answers the way, say, much of the Python community has settled on Black.

The two challenges I’ve encountered basically come back to there being two distinct communities: “Java that doesn’t suck” and “Enterprise Java™”. It is very easy to get people who learned enough Java 6 to get a CRUD job at a bank or government contractor, and they’ll give you an app with a ton of snarled, fragile code and a dependency stack deep enough to make a Node developer wince. It’s harder to find good developers since on paper both of them will look the same to HR — IT or CS degree, 10-15 years of experience, AWS experience, etc. — so you’ll have more work filtering than you would with non-default languages.

Re: Ask HN: Using Java for a web application in 2023

#19
post #8

Personally, I'd say that either Kotlin or Java are okay language choices (and the JVM runtime is good too), not unlike something like modern .NET. The performance is good, the type system is passable, you have bits of FP and OOP to use at your leisure, there's a rich ecosystem of a variety of libraries out there. == ARCHITECTURE As for the architecture, I'm still a proponent of separate back end and front end compone…

> Spring Boot is the boring and dependable choice, it does basically everything you might need and is not too hard to configure.

Not sure I agree here. One needs to know a good amount about how Spring works before they can start configuring Spring app. Methods annotated with @Bean would look strange to any newcomer, or how about trying to figure out how messaging libs set up works (let's say Kafka) would be very confusing.

Re: Ask HN: Using Java for a web application in 2023

#20
post #14

Java web applications I’d describe as “boring technology” if you want typical rest applications with SPA frontend or a full stack server side rendered (SSR) app. By boring I mean it works with little fuss or churn. Depending on your scale/budget they’re a bit more expensive to host due to JVM memory requirements but performance is good. Not a Java issue but a issue if you choose a language other than JavaScript for t…

For web apps, why use two languages if you can get away with only one? unfortunately, is hard to beat JS/TS here.

Depends. I hate the whole JS ecosystem and NPM hell so if I can get away, I do. I can never go for JS on the backend personally. I am happy with good old PHP, Go, Python etc.
Post reply on HN