Live data from Hacker News

Java Is Underhyped

jackson.sh

171–180 of 808 posts

Re: Java Is Underhyped

#171
post #7

There are a few reasons to avoid Java today. - The programs are very verbose for the functionality they provide. There are countless lines of getters, setters, and trivial constructors. While IDE helps to write them, it makes reading existing programs slow and frustrating. Lombok helps, but very few programs use it. - If you do want to use Java ecosystem, there is Scala. It also has strong type system, nice IDE suppo…

> Scala [is] easier to read and write that Java

You either haven't used Scala, or you haven't used Java.

Re: Java Is Underhyped

#172
post #121

Earlier quoted context omitted.

Python is generally less performant. Go has a smaller ecosystem. IMHO, YMMV etc.

How did you manage to miss the entire point of the comment?

I didn't, thanks.

I think that there are use-cases in which java is more performant than his low-performance options, and can be as performant as his high-performance options, while providing a much larger ecosystem.

I think the parent poster actually makes a very weird set of choices - "when my high level choice, python, is not cutting the mustard, I am happy to throw away breadth of support entirely in the name of optimisation."

It's up to him what his preferences are, of course, I'm not saying they're wrong as much as personal.

Re: Java Is Underhyped

#174
It's not perfect for anything but it's very robust and dependable.

The API's are comprehensive, well thought through, to this day it's bizarre nobody has copied Javadoc. Python docs drive me mad.

For a script - Python. For the web Typescript. For low level C or Rust.

But Java is quite powerful for anything that stretches in between: not the fastest to write, but generally fast, the tooling is robust, the performance is quite good usually.

And I love that it's uncool.

Re: Java Is Underhyped

#175
post #168
post #121

Earlier quoted context omitted.

Python is generally less performant. Go has a smaller ecosystem. IMHO, YMMV etc.

You're right, but: * performance is not really an issue for most software ("97% of the time, premature optimization is evil"). A well designed software doesn't suffer from performance issues with current computer performance, unless you do AI or bleeding edge graphics or science simulation. * there are ways to speed up performance sensitive parts with something else than java, for example by using C/C++, would it be…

The OP brought up performance reasons to choose language. :shrug:

> I remember playing minecraft with friends, and the server was regularly crashing because it was out of memory, or something like that.

I've seen this, but I don't think you can really use one server program running out of RAM as indicative of much. I do still find the pre-setting of max memory on the command line a little bit odd though.

Re: Java Is Underhyped

#176
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…

I've seen plenty of even small Java projects becoming hard to manage as well. The design pattern hell is a thing. You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) Not to say Java is not a great language for big projects, it certainly is well equipped for that, especially because it has superb tooling available on the market. But I've done plenty of big projects in Python, some ended…

> You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :)

I think this joke is probably about as dated as the versions of java it was made about.

Re: Java Is Underhyped

#177
post #4

While attneding university, Java made an appearance in 4 different classes, the first two clases students take are Java classes. One interesting thing to note, is that for these classes, none of the students were allowed to use any of the Java libraries, or external libraries, everything had to be built from scratch. So I didn't actually learn about using external libraries or Maven until later when I started develop…

Java is poor choice as a language for teaching programming. There are simply too many irrelevant bits that will get in the way of learning.

I think the opposite actually.

Python, JS and C/c++ are full of idiosyncrasies.

Java allows students to quickly get up and running and focus on the 'CS'.

That said, Python might be more practical for anything applied in school.

Re: Java Is Underhyped

#178
post #7

There are a few reasons to avoid Java today. - The programs are very verbose for the functionality they provide. There are countless lines of getters, setters, and trivial constructors. While IDE helps to write them, it makes reading existing programs slow and frustrating. Lombok helps, but very few programs use it. - If you do want to use Java ecosystem, there is Scala. It also has strong type system, nice IDE suppo…

> - The programs are very verbose for the functionality they provide. That's true for 2005, not 2021, with var, type inference, closures, streams, and other such features. And since forever getters/setters are auto-generated by the IDE (including Emaca and Vim) and can just be ignored, and Java today has Records which don't need them. > - If you do want to use Java ecosystem, there is Scala. Now you have exponential…

> No, you really don't.

Production algorithmic trading app, 100k LOC, 8 GB heap, 258 threads, right now only using 105% CPU; Java 11, and this is the complete extent of JVM tuning we have done:

-Xmx8g -XX:+ExplicitGCInvokesConcurrent

Back in the Java 1.x days, you often did need to do careful JVM tuning. But for the past few years, you haven't. The ergonomics are enough for a very broad range of workloads.

Re: Java Is Underhyped

#179

Speaking as a near 20 year Java programmer, Java is criminally bloated at every level. The ecosystem has been covering for its shortcomings since y2k. That ecosystem is so thick and full of abstraction that no two devs from different framework backgrounds would recognize the others code as Java. And the abstraction... it is a language for people who are more interested is the abstractions than actually getting things…

Honestly I think it's time for some of these frameworks and abstractions to die, and to stop trying to be everything to everyone.

Ship functionality as libraries, not massive sets of "Thou shalt do it our way in our all-encompassing , over-complex, hard to debug straitjackets."

The language itself is not what it was, it's very capable.

Re: Java Is Underhyped

#180
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…

I've seen plenty of even small Java projects becoming hard to manage as well. The design pattern hell is a thing. You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :) Not to say Java is not a great language for big projects, it certainly is well equipped for that, especially because it has superb tooling available on the market. But I've done plenty of big projects in Python, some ended…

> You know the joke: a dev has a problem, uses Java, and now has a ProblemFactory :)

I LOL’d at this joke (again) because it’s true, but if we’re honest, it’s also unfair. ProblemFactory is a bad idiom, rather than anything to do with Java The Language. You could (and IMO, probably should) just use a new Problem().

Java The Language was very stable for a very long time, so IMO the hype and fads got built on top. First we have a constructor - no, now we need a factory, but how to construct a factory? I know, let’s use another factory! All in the same unmodified language.

Likewise, how do we configure an object? First we have methods, but languages are cooler, so let’s build a DSL, no wait let’s use a fluent API so it just looks like a DSL!

I one had a dev replace a constructor call with a fluent builder, so now in the single use case where the object was ever created, we got five LOC where previously we had one.

His code was idiomatic, it was bad engineering, but it wasn’t Java the language.

Java is a pretty great language, but some of the crap people stuck on top of it was (and still is) a nightmare for readability and reusability. I use Go these days, and prefer their more basic approach to engineering, but there is much I miss from Java-the-language.

Post reply on HN