| 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.. |
The reason for Java building being slow is that for whatever reason, the community that develops Java has been inundated with people who are more concerned with flexing their theoretical computer science knowledge than actually making the language spec adaptable. As such, the core language is extremely lacking in features.
For this reason, people built systems on top of the language, such as build systems, dependency injection systems, testing systems, and so on. But again, for someone to dedicate time to building on top of the crap that is core Java requires a certain mindset, which lends itself to extremely bloated code, or things like making a log statement have code that can fetch code from the internet and execute it.
So when you stack all of these on top of one another, thats where you get long compile times from. You have gradle build system, which is Groovy, which then gets compiled to run on the jvm, which then compiles the annotation processors which often write code to a file on a disk, which then gets included along with the rest of the code, which then gets compiled into class files and then jar files.
Also, during execution, because the common guidance is to use extremely bloated and poorly organized 3d party libraries for basic things, all of these libraries have a startup time associated with it.