Live data from Hacker News

Java Is Underhyped

jackson.sh

771–780 of 808 posts

Re: Java Is Underhyped

#771

Earlier quoted context omitted.

>Certainly no less expressive than, say, Python or JavaScript. Java can't even have a free standing function without 6 lines of boilerplate minimum and 2 levels of indentation to start. Nominal static typing with weak generics and no almost no compile time programming support - you end up mucking with reflection or code generation if you want to do anything metaprogramming related or non trivial higher order function…

Java 8 has been there for 7 years now. You can have a free-standing function in a single one-liner expression. Function fn = parameter -> parameter + " from lambda"; Using annotations and cglib, you can do all the meta-programming you want.

And how do you expose that function globally ?

Annotations and CGLib -> reflection nonsense and boilerplate - if you tried that and compare it to something like a dynamic language with open types (eg. JS/TS) you are just being dishonest if you're saying the two are anywhere close to comparable.

I remember doing a node ORM extension where I just injected standard revision management primitives into the entity as a part of repository. That would take an insane ammount of work in Java in comparison to get the same API functionality (namely it was mostly transaparent to the consumer)

Re: Java Is Underhyped

#772

Earlier quoted context omitted.

Java 8 has been there for 7 years now. You can have a free-standing function in a single one-liner expression. Function fn = parameter -> parameter + " from lambda"; Using annotations and cglib, you can do all the meta-programming you want.

And how do you expose that function globally ? Annotations and CGLib -> reflection nonsense and boilerplate - if you tried that and compare it to something like a dynamic language with open types (eg. JS/TS) you are just being dishonest if you're saying the two are anywhere close to comparable. I remember doing a node ORM extension where I just injected standard revision management primitives into the entity as a par…

> And how do you expose that function globally ?

Just like anything else. Put it in a package and just static import it from where-ever you need it.

Umm, cglib https://github.com/cglib/cglib is not reflection - its bytecode enhancement. You can inject, create types dynamically, modify types dynamically - all of it is possible. What you just stated is quite straightforward in Java actually and can be fully transparent to the consumer. It's by no means an "insane amount of work".

Now, if you bring up hot language features - sum types, etc - I agree that Java falls behind. But the stuff you offered as criticisms, Java actually excels.

Re: Java Is Underhyped

#773
post #753

Earlier quoted context omitted.

In case of the Dropbox please read this: _But as the company grew, new engineers who joined couldn’t understand the code. Clever code is usually short and cryptic, written by and for the individual who came up with it, but is hard for anyone else to understand—and nearly impossible to maintain. Guido called this “cowboy coding culture”. He recognized its value in our early stages of trying to implement things quickly…

Your last point is not supported by your link - this is an article praising Guido, the creator of Python, and remarking how good Python is.

Sorry, my bad. They already started rewriting core components in Rust.

Here you go:

https://dropbox.tech/infrastructure/rewriting-the-heart-of-o...

Re: Java Is Underhyped

#774
post #686

Earlier quoted context omitted.

I used Kotlin in a large codebase, and one of my only complaints is the compile times. We use Gradle for our build system, and relative to Java it is slooowwww. But we like the other benefits of Kotlin, so it's worth it in the end. But if they could get compile times down, it'd be the perfect language imo.

1.5.0-RC was released a few days ago and contains rewritten compiler code which promises significant speed improvements.

It sure does, I updated everything a few days back and was really amazed. Everything is faster, even syntax highlighting.

Re: Java Is Underhyped

#775
post #677
post #136

Earlier quoted context omitted.

Python projects that start to grow has a tendency to become hard to manage in a way that I have not seen in Java at all. Java is like you say not the greatest at anything but it is also not the worst at anything. Its great for projects where the you don't know what you should optimize for or don't care. If java is to boring maybe kotlin is the way to go. I really like kotlin and in my personal experience the only dow…

Though I prefer Kotlin to Java I can't fathom why IntelliJ's Kotlin tooling is still so inferior to its Java tooling when it was JetBrains who invented Kotlin as a Java replacement.

What are you missing specifically?

Re: Java Is Underhyped

#776

For my use cases, Java has all the wrong compromises: - not high level enough to compete with Python/Ruby/JS/PHP, etc - not low level enough to compete with Rust/D/Nim/Zig - not specialized enough to compete with Erlang/R/Go/Julia - not opinionated enough to compete with Lisp/Haskell So why use Java ? It's good, it's fast, it's productive, it's well supported, battle tested and documented for decades with a huge pool…

Java is great when you need speed approaching Rust/C++ but don't actually need to be the fastest. It's way easier than C++ and will get you 80 percent of the way there in terms of performance

This is oversimplifying probably. The JVM can make your non-optimized code faster than your non-optimized c++ code.

Re: Java Is Underhyped

#777
post #679

Earlier quoted context omitted.

I don't know if something changed, but for sure 2 years ago I used Lombok with IntelliJ.

I don't mean lombok as a library, which works. I mean developing lombok itself

Ah, sorry, haven't done that. It sucks if it's Eclipse only :-(

However I'd expect Lombok users to outnumber Lombok devs 100k to 1 :-)

Re: Java Is Underhyped

#778
post #221

I haven't been coding as long as most (about 10 years) but I've had phases of Java, Ruby, Python, JS, TS, ObjC, etc. If I go onto my GitHub and try to get any of my old projects running I am extremely confident that the non-Android Java ones will still work. All of the other ones will probably have "rotted" over the years and send me down a day-long rabbit hole looking for old dependencies or build systems. There's s…

This, absolutely. I don't think any of my javascript, python projects, or even golang (pre-modules) would even build after a clean checkout. My maven projects? Sure they will build, and the tests will run just like the last time. Java is not exciting, it's just fine. I really don't get the level of hate Java gets in certain circles. It's like people are putting their entire identity on the line based on their currently preferred programming language.

Re: Java Is Underhyped

#779
post #272

Earlier quoted context omitted.

I generally agree, except the part about the low risk of runtime surprises. Java's type system is so weak that it doesn't even prevent null from inhabiting almost every type. The programmer is then forced to manually reason about when a value can be null or not, and of course humans can easily make mistakes in doing so. This inevitably leads to NullPointerExceptions at runtime when a project becomes sufficiently comp…

> Java's type system is so weak that it doesn't even prevent null from inhabiting almost every type. "So weak"? You do realize that this is basically where every language was less than a decade ago?

A decade ago Idris, Agda, Haskell had been around for a time already, there hasn't been that much advance in 10 years. And a decade ago it was also a commonly argued that Java isn't getting a lot in return for its very basic static types, vs simplcity and expressivity that dynamic languages get.

Re: Java Is Underhyped

#780
post #776

Earlier quoted context omitted.

Java is great when you need speed approaching Rust/C++ but don't actually need to be the fastest. It's way easier than C++ and will get you 80 percent of the way there in terms of performance

This is oversimplifying probably. The JVM can make your non-optimized code faster than your non-optimized c++ code.

Agreed
Post reply on HN