Live data from Hacker News

Ask HN: What is a modern Java environment?

news.ycombinator.com

31–40 of 153 posts

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

#31
post #18

This is my experience. For context I do a lot of contract work mostly in banking, ecommerce and insurance. - Spring Boot - IntelliJ - Gradle or Maven - Java 8 features (for various reasons most of my clients do not use version > 8)

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

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

#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 for the toolchain (I prefer the former). Intellij is the best IDE but I get by with VSCode.

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

#33
post #6

Earlier quoted context omitted.

Also using IntellJ. But how is the landscape with the other IDE's these days - is NetBeans keeping up?

Netbeans died an unfortunate death once it moved to the Apache foundation and Sun/Oracle funding died out. https://trends.google.com/trends/explore?date=today%205-y&q=... Unfortunate, because it had (has?) a great Swing and UML editor, built-in for free. Maybe I'm wrong and it's awesome now, but I haven't used it for a while in favor of Eclipse, and now, IntelliJ. This graph illustrates the IDE popularity between Int…

Netbeans was really great, maybe still is, but the noise jetbrains made with the astroturfing advertizing has jetbrains dominating everything.

IMHO Netbeans was ahead of idea in many ways. But since they didn't buy commenteers to hype their product it's pretty much nowhere, at least I don't know anyone who uses it.

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

#34
post #15

Earlier quoted context omitted.

> Try to use Kotlin where allowed If you want a slow build and code that is fun to write but hell to read, that is good advice. > Use kotlinscript as the config language Extremely slow, that is.

I disagree that it's easier to write than read. I tend to think Kotlin is much easier to read than java but harder to write because it tries to enforce good Java patterns at a language level. I agree that these will slow down your build, but not significantly, and at the benefit of developer comfort to make changes. Incremental compilation largely erases these slowdowns.

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.

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

#35
post #28
post #7

Earlier quoted context omitted.

I am using it now because the team is using it, but cant figure out in which way it is supposed to be better then Eclipse. It looks somehow better, but it seems strictly inferior in terms of what it does for me.

I'm very curious to hear what Eclipse does that IntelliJ does not match.

Elipse keeps a complete Java representation of the source code in memory, (not the classes) that's why it can find compile errors before saving. This comes at the cost of lost of RAM, some projects are just too big for eclipse so IntelliJ is your only option. But that eclipse model can be used for lots of cool tricks, you have access to it in the plugin API, so for example you can enforce coding standards before even saving code.

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

#36
I can't speak to how prevalent it is in the industry, but something my team has started doing in our web services is building with GraalVM and deploying native images. The build time can be super long, but the benefit is incredibly fast start-up time, which really benefits horizontal scaling. We're using Quarkus (https://quarkus.io), which is largely built on Vertx which was mentioned elsewhere, but other frameworks (Micronaut (https://micronaut.io) comes to mind) make it easy and SpringBoot is also working on support. If your doing containers/kubernetes native images feel like the way to go.

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

#37

IDE: IntelliJ IDEA https://www.jetbrains.com/idea/ Nothing else seems to come close, they have a Community version, nowadays Eclipse and NetBeans both feel slow but Visual Studio Code with Java plugins lacks refactoring abilities one might expect in an IDE for non-trivial projects. Also, if you get the Ultimate package of their tools, you get all sorts of other useful tools, personally i also enjoy WebStorm and DataG…

> Nothing else seems to come close, they have a Community version, nowadays Eclipse and NetBeans both feel slow

After not using Eclipse for 10 years, I had to use it again last month for a very large existing project. I was pleasantly surprised. It felt faster than IntelliJ.

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

#38
I'm about 3 years out of date on Java, but if I were spinning up a new project it would be:

* Latest JDK

* Spring Boot

* JQuery/Bootstrap

* Eclipse (with Vim keybindings plugin)

Caveats:

* If it was a personal project or only a very small team, I'd start with Kotlin

* I haven't tried IntelliJ in quite a while and would give it a shot to see if I wanted to switch off Eclipse now

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

#39
post #20

* 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…

Okio is very nice, and Okhttp is quite ergonoic, but I can't recommend Okhttp if true async is on the table (it's just blocking and threadpools under the covers).

Admittedly it's been awhile since I've written Java, so most of this is what I remember and what I've seen successful teams using -- got any links to a "true async" in Java? I was under the impression that all Java async work was backed by thread pools.

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

#40

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…

This is it. The irony is that the modern Java stack uses the JVM & classlib, but a different language.

If you want to go full hipster, there is Micronaut (also Quarkus) and if you'd like to go a bit off-charts, there is Dropwizard. I don't think that they offer anything extra over SB though.

Post reply on HN