Live data from Hacker News

Is it common for Java devs to wait 30s+ for a recompile after making any change?

news.ycombinator.com

1–10 of 20 posts

Is it common for Java devs to wait 30s+ for a recompile after making any change?

#1
I'm mostly used to Python programming..

I seems like the Java/Kotlin world largely might be sort of used to waiting 30+ seconds for a recompile after making even a 1 line code change.

I've asked around, and I've heard that yes there are ways to speed it up if you setup everything correctly and have a good strategy in place for using cache.

However, I'm getting the sense that most of the Java projects out there might have a horrific dev experience where the devs might just accept that its Java and that's how it is, in which case, there must be a lot of miserable Java devs who waste most of their day waiting.

Please someone say it isn't so..

Re: Is it common for Java devs to wait 30s+ for a recompile after making any change?

#3
It depends on your workflow doesn't it?

If you're just re-building on the command line every time you make a change, and your build takes 30 seconds, then yeah you wait.

If you're working in an IDE, running your project out of the IDE, then you might have more options. For example, in IntelliJ IDEA, you can often reload changed classes and hot update the running program.

Re: Is it common for Java devs to wait 30s+ for a recompile after making any change?

#4
No, it's not normal to wait for the IDE. Maybe you need more RAM, to adjust JVM settings in your IDE, fix some weird issue. IntelliJ has index updater bugs after releases sometimes, for example, and the Bazel plugin has lots of problems.

Re: Is it common for Java devs to wait 30s+ for a recompile after making any change?

#6
I don't have a lot of Java experience, but this definitely doesn't line up. For any compiled language, modern compilers for C++/Java are generally fast enough for most codebases, BUT companies need to invest in their actual build processes to keep things optimal.

If the dependency tree is such that making a 1 line change still causes a 500 file recompilation, yes, you could be seeing a multiple second wait.

Re: Is it common for Java devs to wait 30s+ for a recompile after making any change?

#8
The IDEs support incremental recompilation and it usually takes at most a couple of seconds - unless your project is huge and you work on some core module on which everything else depends. That's not common in Java though (more common in C++ codebases, where people like to have for example their own custom collection classes).
Post reply on HN