Hacker News new | ask | show | jobs
by jim33442 106 days ago
Most of the young people like me learned Java as a first language in AP Computer Science, then probably again in college. We were tested thoroughly on all the OOP details and required to use that in projects. The most popular video game is/was also in Java, and people love to mod it.

But still nobody wants to use it given the choice, because it sucks. 75% of the code you write is boilerplate mainly thanks to OOP, the com.foo.bar stuff is an eyesore, and it somehow uses even more RAM than Python. That's without getting into the enterprise cruft land where each method has 3 annotations on it, where the annotations themselves are maintained by an entire outsourced team.

1 comments

Well, you should have learned about the language something in the meanwhile then.

75% boilerplate, come on. It has records and pattern matching now. Many of the cases of boilerplate are strictly self inflicted. And this criticism is absolutely laughable in a thread about Go, where you have to repeat some error ritual every 3 lines, losing the signal in all the noise. Java is a much more concise language than Go.

com.foo.bar solves a very real issue that is a big problem in e.g. the Node and Rust ecosystem (package name squatting).

And it uses as much RAM as you set it to use. It's true of every managed language that more memory equals less work to do, that is better throughput. But Java's GCs are the state of the art, it will work just fine with half the pre-configured memory.

Records and pattern-matching didn't exist back then and are only used in new codebases. That isn't enough to fix it anyway.

The Go error handling is bad enough that it makes the lang not a top choice for me. Seems like entire vision of Go was being the opposite of C++ in every way, and that resulted in something halfway decent, but it unfortunately doesn't use exceptions. You get stuff done in fewer loc than in Java at least, and it always had solid m:n greenthreading, and the GC just works without having to tune it.