Live data from Hacker News

Ask HN: What is a modern Java environment?

news.ycombinator.com

91–100 of 153 posts

Re: Ask HN: What is a modern Java environment?

#91

The stack I've seen, used and liked at many clients is: Spring Boot, Kotlin, IntelliJ. Which of course means all the old discussions: Jetty/Tomcat/JBoss/GlassFish, GSON/Jackson, Hikari/C3PO/etc, etc are now mostly moot, since most just use the Boot defaults until they need something else. Kinda nice, actually. Less bikeshedding, can get a project up and running without taking a stand on all these things. Most clients…

Yes. Perhaps to add to this, use a modern asynchronous IO framework. If you use Spring Boot, ignore some of the legacy stuff that still comes with it and make sure you use webflux with Kotlin co-routines. Also use Asynchronous IO for talking to your database, queues, etc. Kotlin makes all of this easy. Hibernate is something I tend to avoid for various reasons but apparently recent versions of that now also support a…

I really wouldn’t go the async way unless it was deemed absolutely necessary for maximal performance — it makes reasoning/debugging much harder with often not much gain.

Also, if one can just wait a few years, loom will make many part of it obsolete - when blocking code will magically get non-blocking while it retains the readibility.

Re: Ask HN: What is a modern Java environment?

#93

I'll chime in my opinion: Java is getting something right that I don't see much elsewhere: Dependency Injection. Combine this with a mocking framework and you can write _actual_ isolated unit tests for every single part of your stack. We're fans of CDI, it's a more polished Spring framework without the legacy weight. We're developing in Quarkus, MicroProfile, and bigger monoliths in Apache TomEE. We use ActiveMQ exte…

> Java is getting something right that I don't see much elsewhere: Dependency Injection. Combine this with a mocking framework and you can write _actual_ isolated unit tests for every single part of your stack Since dotnet core started this has been front and center in C#. So there are other stacks doing this.

Very happy to see this. I think it's a great pattern. It pushes functional concepts into code and stuff like state management into the runtime.

Re: Ask HN: What is a modern Java environment?

#94

I have been thinking of writing up a series of articles on this. Without going into too much detail: * IDEA * Deploy on Google App Engine, Digital Ocean App Platform, Heroku, Elastic Beanstalk, etc - get out of the ops business entirely. * Guice as the backbone, no Spring/Boot. I wrote a tiny dropwizard-like "framework" to make this easier: https://github.com/gwizard/gwizard but there's a laughable amount of code her…

Cool, it is a lot to start researching but you sound like you use a very similar style to things I am used to in other languages.

On guice/gwizard/maven, if I understand correctly I would be defining new guice DI for something like a message broker (and gwizard's solutions for similar modules might serve as a template) while probably just using direct dependencies in maven for something that doesn't need to be mocked in unit tests or replaceable in production?

Re: Ask HN: What is a modern Java environment?

#95
post #43

Over the last five years, the Java Platform has seen a tremendous amount of evolution and improvement in a variety of areas, including: language features in Java, Kotlin, and Scala; Functional Programming; dev environments; test workflows; Reactive; Stream processing; and distributed data.

Is Scala still in trend?

I would say it is no longer a hyped language (Kotlin took over that position), but it recently became Scala 3 which was a huge revamp. It polished some of the edges regarding implicits (which is a really useful and novel feature), and it has a very advanced and elegant type system with optional null-checking.

Re: Ask HN: What is a modern Java environment?

#96

Earlier quoted context omitted.

Containerization is great. It allows you to write all the infrastructure for you Java app as code and then just simply type 'docker-compose up' to get it running (or whatever your orchestrator). This makes it super portable. Just something to think about. I personally think the win's from Containerization are greater than the challenges.

I admit we do miss that part. Instead for us it's `sudo apt -y install app-name`

installing the app locally isn't as sustainable. The data and configuration for test environments gets scattered across the system and is less reproducible for new comers. As changes are made to the test environment, developers have to then install/update/reconfigure manually. It becomes an nmo effort with less consistency and more error over the single line docker-compose up

Re: Ask HN: What is a modern Java environment?

#97
post #50
post #31

Earlier quoted context omitted.

what about lombok? Edit: just curious if you think it's standard

With records now being supported in Java, wouldn't Lombok be less needed?

Unfortunately not. Records are not compatible with JPA, so classic beans with getters and setters would still be a choice for many people. Record-friendly ORMs do not exist yet (I’m currently working on one).

Re: Ask HN: What is a modern Java environment?

#98

I'll chime in my opinion: Java is getting something right that I don't see much elsewhere: Dependency Injection. Combine this with a mocking framework and you can write _actual_ isolated unit tests for every single part of your stack. We're fans of CDI, it's a more polished Spring framework without the legacy weight. We're developing in Quarkus, MicroProfile, and bigger monoliths in Apache TomEE. We use ActiveMQ exte…

I've been a developer over a decade, never touched the JVM because I always figured it was bloated Enterprise garbage.

I did a project using GraalVM's polyglot abilities and needed an API.

Tried Spring, Micronaut, Helidon, Ktor and Quarkus.

Quarkus is the best web framework I've ever used, in any language. Can't go back now.

It's so well-architected that I was able to contribute an extension for Scala 3 support within a month, and the Redhat employees have answered every question + issue I've raised.

Being built on top of the Microfile spec and using Vert.x is a hell of a combo. Vert.x is the best thing since sliced bread too.

Can't recommend Quarkus enough, whether you write Java or Kotlin or Scala (I'm a big Kotlin fan myself).

Re: Ask HN: What is a modern Java environment?

#99

Earlier quoted context omitted.

I admit we do miss that part. Instead for us it's `sudo apt -y install app-name`

installing the app locally isn't as sustainable. The data and configuration for test environments gets scattered across the system and is less reproducible for new comers. As changes are made to the test environment, developers have to then install/update/reconfigure manually. It becomes an n m o effort with less consistency and more error over the single line docker-compose up

Don't disagree, but we just avoid writing stuff where you need to have 10+ apps running locally to run "an app". That itself isn't sustainable architecture, those should be one app in a monolith.

That being said, to your point, we do have some inter-service dependencies that have to run separately. We haven't figured out a good balance yet, but it's the exception not the rule fortunately, and everyone "just knows" how to run an extra app in those extreme cases.

Re: Ask HN: What is a modern Java environment?

#100

Earlier quoted context omitted.

Containerization is great. It allows you to write all the infrastructure for you Java app as code and then just simply type 'docker-compose up' to get it running (or whatever your orchestrator). This makes it super portable. Just something to think about. I personally think the win's from Containerization are greater than the challenges.

I admit we do miss that part. Instead for us it's `sudo apt -y install app-name`

do you have a 'sudo apt uninstall app-name' to clean everything up?
Post reply on HN