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
Ask HN: What is a modern Java environment?
41–50 of 153 posts
Re: Ask HN: What is a modern Java environment?
#42* 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…
> 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.
Re: Ask HN: What is a modern Java environment?
#43Over 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.
Re: Ask HN: What is a modern Java environment?
#44The 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…
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
Re: Ask HN: What is a modern Java environment?
#45Spring Boot wrapped in a Docker container and a frontend written in JS using React, Angular or similar. So maybe the frontend and deployment has changed. The rest probably not so much. Java versions 8 and 11 are by far the most common. Lambdas were introduced in version 8.
Re: Ask HN: What is a modern Java environment?
#46Earlier quoted context omitted.
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?
#47Re: Ask HN: What is a modern Java environment?
#48The 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…
If you feel more adventurous. Ktor is also quite nice and a lot more lightweight than spring. They have a pretty big 2.0 release coming up for that with a lot of nice improvements. Ktor is also a nice alternative for doing http clients. Kotlinx serialization is the way to for serialization; especially if you are interested in multiplatform. Spring supports that as well since a few releases.
If you use Kotlin, stick with Gradle and use the kotlin scripting variety. Maven is very much a second class citizen in that ecosystem. It's supported (grudgingly) but not that actually that widely used. A lot of older Spring projects might still use it because they started out as maven/java projects and only later added Kotlin. However, if you start from scratch, just use gradle and take the path of the least amount of resistance. You'll have an easier time and essentially all of the Kotlin documentation assumes you use gradle. For things like kotlin multi-platform, maven is an afterthought. I'd be surprised it works at all actually for that.
Re: Ask HN: What is a modern Java environment?
#49IDE: 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.
I last did 1-2 years ago and it still wasn't quite passable in a Java project with 4000-5000 source files, though maybe that's because of the plugins involved (e.g. myBatis for ORM which has Java interfaces and XML mappers for SQL queries) or mixing technologies like JSP/JSF and also having JS files with front end resources in the same codebase.
Of course, i'm talking about the full Eclipse with the JDT package and a bunch of other stuff, some folks have more slim installs: https://www.eclipse.org/jdt/ In that regard you can indeed have a lot of flexibility. Oh and i think that a while ago they also tried having lightweight solutions like Che and Theia as well.
Recently i've actually started splitting up the old legacy projects into multiple monorepos (e.g. "back-end" and "front-end" folders with the occasional supporting service in there as well, not necessarily everything in a single repo) and the impact has been pretty noticeable!
For starters, separate instances of IntelliJ and WebStorm for different kinds of code (Java and JavaScript/TypeScript) seem to work far more quickly, the builds also are generated faster (since fewer resources to copy) and i don't need to cry when i forget to tell the IDE to ignore node_modules.
Re: Ask HN: What is a modern Java environment?
#50This 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