News for hackers. Stuff that matters.
Re:Ask HN: Using Java for a web application in 2023 by ithrow on Wednesday February 08, 2023 @07:57PM (#34718217)
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 by silisili on Wednesday February 08, 2023 @08:17PM (#34718383)
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 by codegeek on Wednesday February 08, 2023 @09:04PM (#34718813)
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.
Re:Ask HN: Using Java for a web application in 2023 by thiscatis on Wednesday February 08, 2023 @11:21PM (#34719708)
TypeScript on the backend gives you that same PHP feeling though.
Re:Ask HN: Using Java for a web application in 2023 by acdha on Wednesday February 08, 2023 @09:16PM (#34718908)
That “if” part carries a lot of weight. There’s a whole branch of questions around the quality and suitability of tools available - for example, I was surprised when we hired a couple of JS specialists and their Next.JS project left me surprised to see how many areas it was behind Django circa a decade ago when it came to basic things like performance, authentication, internationalization, etc. and that massive tool chain soaked up a good chunk of time on an ongoing basis.

The deeper question is how often you actually benefit from code reuse. There are certainly some areas where you can share things but you also run into a lot of coordination concerns because the environment for JS in a browser is not the same as in Node, which increases the friction of sharing, and a large chunk of the benefits are things like data validation which can also be substantially eased with things like JSON Schema. Simplifying those test matrices and formalizing your boundaries has more value than I tend to assume at first.

Re:Ask HN: Using Java for a web application in 2023 by emantos on Wednesday February 08, 2023 @09:17PM (#34718916)
In typical organizations, you always have a grizzled backend developer well-versed in creating REST backends in Java and a frontend developer well-versed in whatever. So you play to their strengths.