Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd go completely insane if it took more than a few seconds to compile something, especially as I like compiling frequently.

I remember having to work in Java codebases, and it was an absolute nightmare. Slow was the name of the game at all levels: slow to design anything, slow to write the code required, slow to navigate, slow to compile, slow to start, etc.

What are the nature of the changes you're making? Is it something you can write and debug in another (faster) language, then translate to the main language? If you were able to do it this way, then you wouldn't need as many compilations.



> I'd go completely insane if it took more than a few seconds to compile something, especially as I like compiling frequently.

I know what you mean. For example, once you get used to working on JavaScript web apps that have almost instant live reload time on save it's very, very painful going back to apps with a 10s compile/reload time let alone over a minute.


What language are you using now that has faster compile times with a codebase similar in size to what you worked on in Java?


It seems to be more than compile times. Something about Java, the IDE, and all the other tools/plugins/whatever make it painful to use.

The first thing that usually happens when there's a switch from Java to most other languages is a shrinking of the codebase. That is, it's not uncommon to go from 200,000 lines of code to 20-30,000.

If you still need the runtime speed Java offers, then that's one thing, otherwise, you can use some dynamically typed language like Python or Ruby. I suppose there's also Go, as many can't go without static types.

At the end of the day (especially if all compile times end up being similar), I'd prefer almost any other language over Java. Swift, Kotlin, Nim, Rust, Elixir, Crystal, Julia, D, C#, anything.


> Something about Java, the IDE, and all the other tools/plugins/whatever make it painful to use.

That's an issue with your toolchain.

> The first thing that usually happens when there's a switch from Java to most other languages is a shrinking of the codebase.

This is debatable and depends heavily on the langauge you're moving to. Further, even if true, it will definitely result in either a performance hit or a code complexity hit (heavy use of FP), or even both.

> I suppose there's also Go.

I haven't seen the numbers comparing compile times for equivalent Go and Java codebases, so I cannot comment on that. I'm assuming that Google's main goal with Go is to improve compile times relative to C++ and Java, which they extensively.


Not my toolchain, whatever was the case where I worked. That aside, my main point is that it was generally a slow, painful experience using Java, and it's more that I'm not entirely sure if compile times were the reason (or only reason).

For example, I continually noticed long and painful compile times, but when I mention these things elsewhere, the responses say Java actually compiles very quickly.

There can be a runtime performance hit, but that's mainly if one switches to a language like Python or Ruby. That is, many compiled languages have runtime speeds similar to Java's.

As for equivalent codebase sizes, do you mean literal lines of code, or having them provide the same functionality? I look mainly at equivalent functionality, as 1000 lines in Python can easily be doing much much more than 1000 lines in Java.

You can probably search for comparisons (of Go and Java). In the beginning, Go was indisputably faster, but apparently they've introduced certain changes in the last year or so that's resulted in slower compile times.

Even with slower compile times, it's likely Go still compiles much faster than Java, while also resulting in a smaller, more manageable codebase.


> There can be a runtime performance hit, but that's mainly if one switches to a language like Python or Ruby. That is, many compiled languages have runtime speeds similar to Java's.

Yes, but you won't get a 10x reduction in LOC as you claim. The point is that LOC reduction is usually not "for free".

> As for equivalent codebase sizes, do you mean literal lines of code, or having them provide the same functionality? I look mainly at equivalent functionality, as 1000 lines in Python can easily be doing much much more than 1000 lines in Java.

Functionality. Of course it can, but you sacrifice performance.

> Even with slower compile times, it's likely Go still compiles much faster than Java, while also resulting in a smaller, more manageable codebase.

From what I've seen of Go, you typically need more LOC to achieve the same task compared to Java.


A 10x reduction isn't uncommon, unless the code wasn't doing much (or wasn't very large) to begin with. Either way, the reduction is quite significant.

Where have you seen Go codebases being larger than Java's (with both providing the same amount of functionality)?


Primarily common snippets or tasks I felt were a bit verbose in Go compared to Java, or at least as verbose as Java.

> A 10x reduction isn't uncommon, unless the code wasn't doing much (or wasn't very large) to begin with. Either way, the reduction is quite significant.

I'll shoot your question back at you: do you have any specific examples to back your claim?

I don't like Java either to be frank, but I'm defending it because I'm not convinced by your original claim, i.e., Java has long compile times and is 10x more verbose.


Yeah, use clojure! :D




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: