Live data from Hacker News

Ask HN: What is a modern Java environment?

news.ycombinator.com

51–60 of 153 posts

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

#51
post #44

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…

As someone who hasn't really touched the Java ecosystem since around the time of Java 7, where would you recommend starting? Pick up Kotlin first, then Spring Boot? Or the reverse? And is the free version of IntelliJ good enough? I noticed on the features list that Spring support wasn't listed

Like with any language pick something you want to build and then build it and perhaps don't get too carried away with the level of ambition. Intellij Community edition is fine. It's what I use. Some of the spring support in the commercial edition is nice but I don't really miss it.

If you have some old Java code, a good way to get started is converting some of that to Kotlin in intellij. You'll get familiar with the syntax that way and you can figure out the language as you go. Mostly things are a bit different but not that much. Nicer too. I remember my first afternoon of converting a few tests and then really liking what I saw. That's five years ago.

If you are doing a greenfield project, I'd suggest starting with a simpler framework like ktor. Especially if you come from a node.js or go background. Ktor is very nice. No annotation magic, easy to understand, and you can write a simple http service in a few lines of code. There's nothing wrong with Spring Boot (I use it), but it's just a lot to wrap your head around and figure out. Even just deciding on which bits you should and shouldn't work involves a lot of decision making. It has a lot of legacy features at this point.

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

#52
post #34

Earlier quoted context omitted.

Extension methods? Aliases? Countless more features that are designed to make your code hard to read & understand. Build scripts are generally written once and executed hundreds or thousands of times. It makes far more sense to optimize their performance rather than ease of writing.

It's okay to have a different opinion, but personally I'd never work at a place that did that. Java is already on thin ice and this is simply how I tolerate it and how I've seen successful java teams operate in cloud environments. If you are really seeing dramatic build times, I don't blame you for investigating them, but I'm not going to forgo years of DX improvements just because I heard on the internet one time th…

Java is on thin ice? It's the most popular business language, for good reason. You seem to have some very odd opinions, but that's fine. Bit rude to call people other people their opinions a "vendetta", though.

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

#53
Gradle (with Kotlin syntax), Spring Boot (vertx, ktor or for small or microservices), Kotlin, IntelliJ.

That would be a "modern" stack for me. If you can't use Kotlin, Java has improved a lot since 1.6 you will be pleasantly surprised.

I recommend you start an intellij (Free edition if you want to, even if I still recommend the paid one) and follow the springboot kotlin tutorial below. That will give you a good idea of what the ecosystem looks like these days.

https://spring.io/guides/tutorials/spring-boot-kotlin/

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

#54

Earlier quoted context omitted.

And what are the functions that you use that work better in Eclipse?

Eclipse immediately tells you what is broken when you change an api. IntelliJ does not. You can't stop IntelliJ from saving work. I like to kick of a build, and work on some new stuff while it's going on without saving until the build completes. That workflow is impossible in IntelliJ. You have to down tools, for a long build with lots of tests that can make IntelliJ slower over all. IntelliJ generally more responsiv…

It just takes two check boxes to uncheck to disable that in IntelliJ. I agree it is disturbing that it is a default at first. But it is at least configurable.

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

#55

* Use SDKMan for runtime and sdk management https://sdkman.io/ * Try to use Kotlin where allowed (Maybe unpopular and bad faith response given that you asked about Java, but I don't care -- kotlin's Java interop is way more seamless than Scala or Clojure to the point that its often not even noticable) https://kotlinlang.org/ * IntelliJ * Spring is pretty popular, I've seen a lot of people using Vertx * Square librari…

I'd suggest using koin instead of Dagger. Dagger is alright but mainly popular in the Android world where Koin is the main alternative. However, Koin is native to Kotlin and a kotlin multiplatform project. So you can use it on Android, server development, IOS native, kotlin-js, etc.

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

#56
post #53

Gradle (with Kotlin syntax), Spring Boot (vertx, ktor or for small or microservices), Kotlin, IntelliJ. That would be a "modern" stack for me. If you can't use Kotlin, Java has improved a lot since 1.6 you will be pleasantly surprised. I recommend you start an intellij (Free edition if you want to, even if I still recommend the paid one) and follow the springboot kotlin tutorial below. That will give you a good idea…

Oh and make sure you start with JDK17. I still see people starting projects with 8, you don't want that!

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

#57
post #52

Earlier quoted context omitted.

It's okay to have a different opinion, but personally I'd never work at a place that did that. Java is already on thin ice and this is simply how I tolerate it and how I've seen successful java teams operate in cloud environments. If you are really seeing dramatic build times, I don't blame you for investigating them, but I'm not going to forgo years of DX improvements just because I heard on the internet one time th…

Java is on thin ice? It's the most popular business language, for good reason. You seem to have some very odd opinions, but that's fine. Bit rude to call people other people their opinions a "vendetta", though.

The reason I'm being terse with you and perhaps a bit rude is that you started this reply thread by insulting my opinions for no reason and then continued to reply with what I believe to be both bad faith readings of my comments and naturally argumentative. I know HN values skepticism, but honestly it's tiresome. Anyways, here's my clarifying my previous comment. Please keep in mind that I fully expect you to read this in bad faith, so I've added sarcasm overtly.

Java, for me, personally, in my opinion, is on thin ice. I personally, in my opinion, would never work at a "Java shop" because in my opinion, personally, it conveys a disregard for technical suitability and individuality and supports the idea that engineers should be expendable. I believe, in my opinion, personally, that Java is, as you say, "popular" because it's forced on many workplaces by management. I don't think, in my opinion, personally, that it's a "bad" language, but its heavy use is not proportional to how "good" it is. I don't think my willingness to respond but refusal to be berated by an internet stranger is rude, and yes, I believe you have a vendetta, just like I have a vendetta against Java. If you have to use it, fine -- the above will insulate you from the really terrible things java does, in my opinion, personally. My real advice is don't use java, but see how that's a bad faith response? That's why I kept it to myself.

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

#58
post #32

For backend frameworks, I'd look at Quarkus [1] or Micronaut [2]. Both are geared towards configuration, async processing and native compilation, along with a ton of options to integrate with external systems. For something a bit lighter weight, Vert.x [3] is a good option (Quarkus is based on it). [1] - https://quarkus.io/ [2] - https://micronaut.io/ [3] - https://vertx.io/ You'll need Java 1.8+, and Maven or Gradle…

There's no reason to use 10 years old version of Java. Use 17.

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

#59
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?

Not really. It hasn't seen growth for a while.

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

#60

* Use SDKMan for runtime and sdk management https://sdkman.io/ * Try to use Kotlin where allowed (Maybe unpopular and bad faith response given that you asked about Java, but I don't care -- kotlin's Java interop is way more seamless than Scala or Clojure to the point that its often not even noticable) https://kotlinlang.org/ * IntelliJ * Spring is pretty popular, I've seen a lot of people using Vertx * Square librari…

I'd suggest using koin instead of Dagger. Dagger is alright but mainly popular in the Android world where Koin is the main alternative. However, Koin is native to Kotlin and a kotlin multiplatform project. So you can use it on Android, server development, IOS native, kotlin-js, etc.

Nice, I haven't seen this one. We've been using Dagger to get people off of runtime DI for migrating to serverless, but I'll take a look. I assume it's compile-time DI?
Post reply on HN