15 ms·
Ask HN: What is a modern Java environment?
Hello,
I used Java a very long time ago, like 1.6, and I'm wondering what using Java at work in ~web backend looks like today.
What elements of your stack would you consider most important? Do most projects lean heavily on Spring Boot or something else? Which IDE? Pointers to refreshers or concise introductions you might give a new hire would be handy too.
- PaulHoule 5y agoIntelliJ idea is the best IDE. JDK8 incorporated a lot of great functional programming ideas (though the streams library is awful.). Up through JDK17 there are many improvements including a more scalable runtime. I haven’t been paid to work with Spring since 2013, every project I’ve worked on since has used Guice, maybe Dropwizard. JAX-RS is the dominant paradigm for web back ends these days, particularly if you are writing single page applications.
- jbellis 5y agoI think the Streams designers did an amazing job. One of my favorite things about modern Java. Yes, it's more verbose than Python list comprehensions, but it's both higher-performance (parallelism that just works) and more productive (static typing means it almost always works as intended the first time).
- PaulHoule 5y agoThat's just not true about the parallelism. The work stealing mechanism used by streams doesn't really work. Frequently I've seen people get something like a 1.7x speedup on an 8 core machine and was able to get a 7.8x speedup on the same machine using a ThreadPoolExecutor. For common "embarrassingly parallel" problems there are two parameters you need to set: (1) How many threads to use, and (2) How fine to subdivide the problem. Often the basic work unit takes much less time to complete than the time it takes to switch between threads. For instance a raytracer can probably trace one ray in less than the time it takes to communicate between threads. If you try to parallelize a task with too fine a granularity you get a slowdown not a speedup. You might find you get a good speedup over a fairly wide range of granularities (you might do well with anywhere between 100 and 10,000 rays) but batching of some kind is essential. As for the thread count it depends on if the job is CPU bound. A CPU bound job needs about as many threads as you have cores or SMT "threads". If the job is I/O bound you usually need many more threads to maximize performance, but it's tricky. A web crawler might be able to support 100's or 1000's of threads but if you point all those threads at one server you might crash it, get banned, or both. If the awkward streams API bought you good performance and reliability (let's see... just about zero support for error handling) that would be one thing but it doesn't. Static typing working so well is not a special feature of the streams API but rather one of the rather brilliant engineering that went into JDK 8. You can easily write your own "map()" functions and other higher-order functions that do many of the things the Stream API does. It would really be nice to see a better third-party API.
- mhaberl 5y ago>I haven’t been paid to work with Spring since 2013, every project I’ve worked on since has used Guice, maybe Dropwizard. This is the opposite of my experience. I worked with Java a lot for the last 10 years or so. In the last 3 years literally each request I got for implementing stuff in Java also required Spring (Spring Boot) - and that was dozens of clients.
- biehl 5y agoSpring Boot is the go-to solution for Java where I work. And definitely Intellij as IDE.
- manishsharan 5y agoAnd Maven. Don't forget Maven.
- Hardik_Shah 5y agoOver 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.
- soco 5y agoIs Scala still in trend?
- isbvhodnvemrwvn 5y agoNot really. It hasn't seen growth for a while.
- hiyer 5y agoIt's big in the data science world because of Spark. For general purpose JVM apps I see people mostly going with Java or Kotlin.
- softwarebeware 5y agoIt's Kotlin now. Kotlin has similar expressibility and extensibility, without Scala pitfalls. (Scala pitfalls that people didn't like included new versions having breaking changes, complexity, theoretical/academic features that weren't necessarily useful to consumer applications, and slow build times).
- kaba0 5y agoNew versions don’t have breaking changes, they are just not binary compatible between major version upgrades which is true of many other languages as well. Regarding complexity - scala has many features due to having a small number of clever primitives. Kotlin special cases many common cases, but imo that will be a more complex language down the line. I really don’t know what do you mean by academic features — one can make haskell libs with scala but they are libs, not language features. And build time-wise it is not that much slower than kotlin.
- omgmajk 5y agoIntelliJ Idea for sure.
- sgt 5y agoAlso using IntellJ. But how is the landscape with the other IDE's these days - is NetBeans keeping up?
- the-alchemist 5y agoNetbeans 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=%2Fm%2F01fchg 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 Intellij and Netbeans. IntelliJ became preferred over Netbeans about mid 2014. https://trends.google.com/trends/explore?date=all&geo=US&q=intellij,netbeans https://trends.google.com/trends/explore?date=all&geo=US&q=i...
- adalu 5y agoNetbeans 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.
- jbellis 5y agoGood summary of the language-level changes here: https://piotrminkowski.com/2021/02/01/new-developer-friendly-features-after-java-8/ https://piotrminkowski.com/2021/02/01/new-developer-friendly... ETA: actually if you haven't used it since 1.6 you'd want to find an article on Java 8 as well that covers Streams.
- mooreds 5y agoMy company's product is primarily written in Java. It's a web based auth system, fwiw. I don't write too much code nowadays, but read a lot. From what I can see, here's the stack: * intellij for an ide (with tons of plugins) * prime MVC (https://github.com/prime-framework/prime-mvc https://github.com/prime-framework/prime-mvc) for the framework * mybatis for SQL/queries * java 17 I've also used dropwizard and spring. If it was a greenfield development with emphasis on developer productivity, I'd go with spring any day. Big dev community, tons of doco, a solution for any problem if you can find it.
- davidjfelix 5y ago* Use SDKMan for runtime and sdk management https://sdkman.io/ 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/ https://kotlinlang.org/ * IntelliJ * Spring is pretty popular, I've seen a lot of people using Vertx * Square libraries like Okio, okhttp, retrofit, wire https://github.com/square https://github.com/square * If you're not using spring, use Dagger for DI https://dagger.dev/dev-guide/ https://dagger.dev/dev-guide/ * Overlook netflix abandonware (another unpopular opinion, I'm sure) * Use gradle, not maven. Use kotlinscript as the config language, not groovy
- oauea 5y ago> 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.
- davidjfelix 5y agoI 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.
- oauea 5y agoExtension 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.
- davidjfelix 5y ago
- KronisLV 5y agoIDE: IntelliJ IDEA https://www.jetbrains.com/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 DataGrip for developing front end stuff and working with databases in a separate tool. JDK: whatever the LTS release of JDK is at the time, based on the kind of work that i do (so JDK 17 now) https://adoptium.net/ https://adoptium.net/ As long as you're not stuck with JDK 8, you should be fine in regards to this. But you can definitely enjoy some speed improvements across the releases as well as new language features as well as things like helpful NullPointerException messages. Personally, i'd sometimes also look towards OpenJ9 as an alternate runtime (due to lower memory usage), but that project's future isn't very clear (at least in regards to available container images) last i checked. As for frameworks, pick one of the following: - Spring Boot: mainstay of the Java ecosystem, has a really large amount of integrations and the Boot version also simplifies getting up and running, about as safe of a bet as Rails for Ruby or Django for Python - Dropwizard: probably the closest competitor to Spring Boot in my eyes, but is a more loose collection of a variety of pretty much "standard" libraries, has decent developer experience - Eclipse Vert.X: pick this if you want to work with reactive programming, last i checked it didn't feel quite feature complete, but the performance numbers speak for themselves, even if it feels a bit niche - Quarkus: another modern option that's tailored for the development of performant web services, got a lot of hype in conferences in the past few years - Helidon: pretty similar to Quarkus as far as i'm aware (at least as far as the positioning in the market goes) so figured i'd also mention it In practice, you're most likely to see Spring Boot in existing projects since it's so boring and dependable, though perhaps sometimes you'll also run into the legacy Spring framework (which can be a pain to deal with) or even some of the other ones. Here's a rough performance comparison if you care about that sort of stuff: https://www.techempower.com/benchmarks/#section=data-r20&hw=ph&test=composite&l=zik0vz-sf&c=8 https://www.techempower.com/benchmarks/#section=data-r20&hw=... Build tools: personally, i just use whatever Docker images to base the apps on when available and something like Ansible when not. For the actual toolchain, Maven is still pretty dependable, i guess Gradle is also okay. You might occasionally run into tools like Bazel or Jib, experiences there might vary. App servers: if you need an application server for some reason (e.g. deploy app as .war), Tomcat is still a good option. If you need the EE functionality (e.g. Java EE which is now Jakarta Java), you might need to reach for something like TomEE or Payara Server, though i haven't needed to do that for a few years at this point, since Spring Boot embeds Tomcat and that is good enough for almost all projects.
- mhaberl 5y agoThis 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)
- arez 5y agowhat about lombok? Edit: just curious if you think it's standard
- azth 5y agoWith records now being supported in Java, wouldn't Lombok be less needed?
- ivan_gammel 5y agoUnfortunately 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).
- kaba0 5y agoCould you please share your ORM? I would really like to use java with much less reflection.
- ivan_gammel 5y agoIf you can send me an email at oss+hn[at]esoftworks.com, I will let you know when I will have beta quality code on GitHub. This is a personal side project exploring annotation processing and targeting modern Java (17+), some results will be ready probably in 2-3 weeks.
- ivan_gammel 5y agoFeel free to star this repo and comment: https://github.com/ivan-gammel/orm16 https://github.com/ivan-gammel/orm16
- matsemann 5y agoThe 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 use maven, a few gradle, some used gradle and moved back when no one could understand their config. Gradle might get a second chance now that it can be written using kotlin.
- joshenberg 5y agoCan confirm this is my stack at a fortune 500 web/entertainment company.
- luciusdomitius 5y agoThis 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.
- heurisko 5y agoOr for hipsters there's https://www.jhipster.tech/ https://www.jhipster.tech/
- matsemann 5y agoOne of my first PRs ever was to that project, back in 2013. Then it was a nice starter project, showing how one could move away from the clunky server side rendering frameworks at the time, instead using AngularJS on the frontend and having a backend. And also included a nice simple Spring setup, before Spring Boot existed. So pretty hip, and very lean. Since then it has.. evolved to something quite big, I feel, where one quickly end up with lots of unknown boilerplate in one's project. I mean, it's probably useful in its own way, almost like a Django alternative or something with batteries included. But not very hipster anymore.
- darksaints 5y agoAfter doing some "modern" spring boot / hibernate, I came away wondering how anybody ever thought that was a good idea. The switch to kotlin with ktor took less than a day, and my sanity has been preserved.
- throwaway4good 5y agoSpring 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.
- throwaway4good 5y agoIf you ignore the way frontend is made (JS + rest api ws. server-side rendered html) and how stuff is deployed (containers vs. war-files); amazingly little has changed in Java the past 10-15 years.
- nigerian1981 5y agoI’ve seen the Micronaut framework used instead of Spring Boot a lot recently for AWS Lambda
- smallerfish 5y agoKotlin + Dropwizard. Avoid Hibernate, go with JDBI. If I was starting a new project I'd look at Jooby, which looks pleasant and does very well on TechEmpower benchmarks.
- icedchai 5y agoJDBI is pretty slick. We used it as a previous company. Previous experience was with Hibernate, lower level JDBC, and some other half baked proprietary ORMs.
- kitd 5y agoFor 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/ https://quarkus.io/ [2] - https://micronaut.io/ https://micronaut.io/ [3] - https://vertx.io/ 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.
- isbvhodnvemrwvn 5y agoThere's no reason to use 10 years old version of Java. Use 17.
- kitd 5y agoTrue. I was just stating the minimum level.
- AssertErNullNPE 5y agoI 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 https://quarkus.io), which is largely built on Vertx which was mentioned elsewhere, but other frameworks (Micronaut (https://micronaut.io 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.
- vollmond 5y agoI'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
- luciusdomitius 5y agoMake sure you do give it a try and beyond the initial discomfort too. It has improved leaps & bounds.
- soco 5y agoEclipse as IDE (actually STS - Spring Tools Suite edition) for both Spring Boot and JBoss Tools (yes there's enough work for JEE - WildFly or JBoss EAP). The build would be most of the time Maven (including the assembly plugin) and sometimes would create native Quarkus images for cloud tools (read serverless).
- ta988 5y agoGradle (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/ https://spring.io/guides/tutorials/spring-boot-kotlin/
- ta988 5y agoOh and make sure you start with JDK17. I still see people starting projects with 8, you don't want that!
- MockObject 5y agoI've been doing Java non-stop since before 1.6. I just started a new project, and it's * IntelliJ * Standard enterprise Java JEE 9.1 (JSP, JPA, EJB) * Payara app server * Twitter Bootstrap * Maven * Test driven development using TestNG + AssertJ * Postgres + Liquibase for schema management Code samples now come from https://www.baeldung.com/ https://www.baeldung.com/
- ytdytvhxgydvhh 5y agoJust curious - you mention JSP. Was that mentioning that yeah, JSP happens to be part of JEE or are you actively using it? I haven’t heard of a new project using JSP for a while.
- MockObject 5y agoYes, my new project uses actual JSPs. Granted, there aren't tons of pages to be built in this project, and certainly nowhere near the scale that might call for a different option. For even a few dozen pages, JSP is still just fine.
- ojhughes 5y agoAlong with the various other libraries and frameworks mentioned; * Testcontainers - seamless support for using Docker in integration tests [1] * Project Reactor - nice framework for reactive programming [2] * Executable Jars - No need to deploy a War file to a servlet container anymore. Build an executable Jar with an embedded container. Spring Boot makes this very easy 1. https://www.testcontainers.org https://www.testcontainers.org 2. https://projectreactor.io https://projectreactor.io
- itpragmatik 5y ago- IntelliJ - Java 17 - SpringBoot 2.6.x - Hibernate - Maven - MySQL or Postgres - Liquibase - Swagger/OpenAPI - Docker
- rvcdbn 5y agoBazel, ErrorProne, Dagger, AutoValue, IntelliJ
- exabrial 5y agoI'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 extensively for scaling. ( And I mean extensively... on a modest 512m server, we can push several thousand messages/s reliably to a _lot_ of topics and queues, all with delivered-exactly-once guarantees) We avoid the fanfare of Docker, as really it's not needed for Java apps; they're somewhat self-contained anyway and it created more problems than it solved. For true isolation, we use systemd to create cgroups and chroots and prevent application escapes. For deployment, apps are one-jar'd down to a single executable, then packaged up in a .deb using the jdeb maven plugin. We stick with the unix philosohpy of using /etc/default for env variables that help the app locate their database or LDAP cluster.
- edmcnulty101 5y agoContainerization 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.
- exabrial 5y agoI admit we do miss that part. Instead for us it's `sudo apt -y install app-name`
- cosmotic 5y agoinstalling 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
- splix 5y agoHere is what we use and I'd recommend to others. The most common: - Kotlin for most of the backend code, but Java for shared libs. We still use Java 8 for some libs which may be used in Android, that's an unfortunate reality - Gradle for build config - Spring for application architecture And few things that may significantly improve your dev process, but are not so common: - Spring Reactor (and Webflux) for processing data and requests. Takes a time to learn, but it worth it - Thymeleaf for UI - Spock for testing. Highly recommended for designing tests - Testcontainers for integration tests - Micrometer to see what's going on with your app. I.e., to export all internal metrics to use with Prometheus/Grafana/etc For the environment - SDKMan to manager the environment - Gradle Application plugin or Google's Jib to pacakge your app. First prepares a Zip with all binaries, second a Docker container - IntelliJ IDEA - Github Actions - turns out to be the most usable CI. Though the Jetbrains TeamCity may be better for a large team
- farmerbb 5y ago> Kotlin for most of the backend code, but Java for shared libs. We still use Java 8 for some libs which may be used in Android, that's an unfortunate reality Considering Kotlin is a supported, first-class language on Android, why not write your shared libs in Kotlin as well?
- splix 5y agoI'm talking about open-source libs, i.e., I don't know who is going to use the lib, which env and target language they have, etc. So I think that Java is the best middle ground here because it guaranties the full support of JVM features and 3rd party tools. I mean just avoiding a risk that it would be incompatible with something.
- cimi_ 5y agoWe have a multi-project gradle build, all our code is in Kotlin, we use micronaut as our base framework and we use IntelliJ as our IDE - this setup has worked great for us over the past year.
- stickfigure 5y agoI 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 https://github.com/gwizard/gwizard but there's a laughable amount of code here, you could build it all from scratch with minimal effort. This is about as lightweight as "frameworks" get because Guice does the heavy lifting. * JAX-RS (Resteasy) for the web API. IMO this is the best part of Java web development. HTTP endpoints are simple synchronous Java methods (with a few annotations) and you can test them like simple Java methods. * Lombok. Use @Value heavily. Cuts most of the boilerplate out of Java. * Junit5 + AssertJ. (Or Google Truth, which is almost identical to AssertJ). * Use functional patterns. Try to make all variables and fields final. Use collection streams heavily. Consider vavr.io (I'll admit I haven't used it in anger yet, but I would in a new codebase). * StreamEx. Adds a ton of useful stream behavior; I don't even use basic streams anymore. * Guava. There's just a lot of useful stuff here. * For the database, it really depends on what you're building. Most generic business apps, postgres/hibernate/guice-persist/flyway. Yeah, folks complain about hibernate a lot but it's a decent way to map to objects. Use SQL/native queries, don't bother with JPQL, criteria queries, etc. * Hattery for making http requests (https://github.com/stickfigure/hattery https://github.com/stickfigure/hattery). This is another one of mine. I make zillions of http requests, functional/immutable ergonomics really matter to me. * Github actions for CI. * Maven for the build. Yes, it's terrible, except for every other build system is worse. Gradle seems like it should be better but isn't. I'd really love some innovation here. Sigh.
- smorgusofborg 5y agoCool, 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?
- mnkmnk 5y agoWhat’s the JDK version people use today? My company’s stack is still on java 8.
- valbaca 5y agoMost of our old services are still on 8, slowly migrating those to 11. Sometimes it's trivial, other times it's a pain. Anything new is at least on 11 and 17 where possible.
- gavinray 5y ago- Language: Java 17/Kotlin - API Layer: Quarkus (most projects https://github.com/quarkusio/quarkus https://github.com/quarkusio/quarkus), Vert.x (small projects https://vertx.io/ https://vertx.io/) - DB: Postgres, in-memory H2 for simple stuff - Testing: JUnit 5, Testcontainers to automatically start + stop DB Docker containers with tests (https://www.testcontainers.org https://www.testcontainers.org) - Mocking: Mockito (https://github.com/mockito/mockito https://github.com/mockito/mockito) or Mockk (Kotlin, https://mockk.io https://mockk.io) - Dependency Injection: CDI (built into Quarkus, for Vert.x you can initalize Weld when the app starts https://weld.cdi-spec.org https://weld.cdi-spec.org) - Build tool: Gradle with Kotlin DSL - Other tools: Kover: automatic code-coverage reports from JaCoCo/IntelliJ (https://github.com/Kotlin/kotlinx-kover) Ktlint + Detekt: Kotlin linting/static analysis (https://ktlint.github.io, https://detekt.github.io/detekt) PMD, Spotbugs, Nullaway: Java linting/static analysis (https://pmd.github.io, https://spotbugs.github.io, https://github.com/uber/NullAway)
- seymon 5y agoWhich JDK distribution is used today? There are so many to choose from.
- AtlasBarfed 5y agoIMO: IntelliJ for IDE (Community edition is free). #1 reason is it supports Kotlin and Groovy very well out of the box. Eclipse is still a plugin disaster, and the language support aside from Java is pretty bad, although I haven't bothered to check in a few years since IntelliJ CE was released. Gradle for builds. It is still copy and paste setup, but at least you can do a lot more things than rigid Maven. Groovy + CompileStatic (personally) for the actual JVM language but admittedly I haven't tried Kotlin yet. Even with closures and other improvements, base Java can't compete with either of those. Spring Boot for your enterprisey stuff/REST services which you are likely using it for. It's such a standard at this point. Unit tests: Spock. Spock is awesome. And very well supported by IntelliJ for autoformat, another BIG reason to use IntelliJ. Man, web frameworks on Java that don't just use it for an AJAX service layer? Who knows.
- ActorNightly 5y agoPersonally, after the log4j fiasco, I wouldn't touch Java. The standard ecosystem setup is to use all the major 3p libraries for all your functionality (Jaxrs, swagger, log4j, jersey, e.t.c) While this generally works, the ecosystem is full of holes (like log4j), and crappy behavior. You get things like "javax.ws.rs.ProcessingException: Already connected", exceptions which mask underlying issues like not being able to find the endpoint, or SSL certificate error, mainstream clients for things like Redis having issues with multiple connections and unable to switch to master nodes, and so on. The core language itself is very "dirty" (Integer vs int, requiring a class for the main function, e.t.c). The standard way annotation processors add functionality is to basically write out java files, (or in the case of the ever so popular Lombok, they hack the AST). Because of how annotation processors are run, often times an error during annotation processing with dependency injection will result in very cryptic errors, often about things that were working before that you didnt change. And on top of everything, jdb debugger is pure garbage, forcing you to use bloated software like IntelliJ for any decent functionality. Yes, you can learn the ecosystem and its idiosyncrasies, or you could just write the thing in Python or Node with a much more efficient workflow. Network latencies dominate the processing speed these days, and infrastructure is cheap compared to developer time.
- dgb23 5y ago> Network latencies dominate the processing speed these days I want to see data on this. It gets repeated over and over but this doesn't match my experience at all. Am I crazy?
- ActorNightly 5y agoIt takes me about 250ms to load hackernews as seen on the browser debug network tab. The total compute for that request is minimal. Speeding this up may reduce total infrastructure costs, where if everything is kept static you will see benefits long term, but in terms of reducing total latency, it will be next to irrelevant.
- dgb23 5y ago
- shaman1 5y agoSpring Boot (embedded Tomcat/Jetty/Netty) Lombok Gradle, Guava JUnit 5, testcontainers, WireMock Logback, Slf4j Okhttp, Open Feign, RestTemplate Micrometer OpenApi, swagger Liquidbase, jooq - db stuff This is your run of the mill stack Dropwizard, Vert.X seem to be less used nowadays, Spring has mostly won the show Heard people using Kotlin, Quarkus, Micronaut but that's niche stuff
- fulafel 5y agoMany use other languages on the JVM. Scala, Clojure, Kotlin etc. Besides the naked functionality, the language communities and cultures have their varying strengths. Eg quality of answers or libraries you easily find. The years long constant stream of deserialization vulnerabilities, like yesterday's Spring RCE, are also largely absent from other JVM languages.