Live data from Hacker News

Java Is Underhyped

jackson.sh

201–210 of 808 posts

Re: Java Is Underhyped

#201
I remember when Java had the hype - Virtual Machine! WORA! Runs in your browser! Your microwave will have Java! That was around my 3rd year in CS at university.

A few years passed and I got to program in Java in a commercial environment. It was J2EE 1.4.

It was bloated, had a really heavyweight and crappy ORM (JavaBeans? Active Beans?). As a framework it sucked. Also it was boring business applications, the cool kids used Python at that time.

Just my personal snapshot of how Java lost the hype for me - crappy "dozens of layers" framework and an unappealing niche.

Re: Java Is Underhyped

#202
post #176

Earlier quoted context omitted.

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.

Generally the Python codebases I've looked at have been more straightforward and therefore more immediately readable than Java codebases. You could write a simple codebase in Java, but if so many people use it to write complex monoliths, maybe the language does have some (in my view negative) influence.

Re: Java Is Underhyped

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

As a Java developer: - I have no trouble reading java and have a hard time reading the 'less verbose' languages. There's way too much implied meaning and information only gleamed through tooling or backtracing, like determining the type of a variable that is declared with var - IDE support for Scala is half as good as Java and I suspect a good reason is the language. The auotcomplete in intelliJ is almost as bad as i…

Yup. As a C++ developer back in the day, I had no trouble reading Java when I first started using it. Indeed it was immediately easier to read than the language I'd spent around a decade with.

Re: Java Is Underhyped

#204
post #121

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…

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

Python code which uses stuff mostly from the standard libraries isn't really that slow. Parsing a JSON? Call a wrapped C function. Process a media file? Call a wrapped C function. If you keep the actual CPU-intensive stuff in C code, the ops executed by the Python interpreter can be negligent.

Re: Java Is Underhyped

#205
post #182

Earlier quoted context omitted.

Dropbox, instagram, google and youtube all were written in Python at some point. Languages don't scale, architectures do. But even when the language became the bottleneck, they went the road of rust and go, not the road of java. Again, not to say Java is not used by those companies with great success.

I bet it has more to do with their HQ location and feeling trendy than anything else.

Well, it's true popularity in tech is not necessarily related to quality.

Trending does have an impact.

But by experience, having a killer feature, and a good adoption story usually does much more.

E.G:

- PHP: easy to make web page in 2001

- JS: monopoly on the client side web

- Go: simple concurrency and binary production

- Rust: borrow checker

- Python: "yes, you can do that too. Also in 2 lines"

Etc.

Re: Java Is Underhyped

#206
post #11

Earlier quoted context omitted.

I am sorry, Go? That can’t be right. I even doubt it’s any more verbose than python or swift. You CAN make it verbose that’s for sure.

> You CAN make it verbose that’s for sure. No true scotsman? Even if you want to argue that Java CAN be made more terse, the vast majority of Java that exists today is incredibly verbose. Even running a Java program is verbose. Java is the only language I've used where it's more common to have a shell script that starts your Java program than just running ./helloworld. And yes, Go is less verbose than Java. Go might…

> And yes, Go is less verbose than Java

No, this is utter, utter nonsense. I have written plenty of both, and it's not even close.

If you are going to press this extraordinary claim, you need to supply at least some evidence for it.

Re: Java Is Underhyped

#207
Java (and JVM) sure has its advantages. And I enthusiastically advocated it in the nineties, when no one seemed to see its strengths.

It was simple, performed well (other than GUI and classloading sometimes took a minute) and was very portable. I even wrote some demos in it in the late nineties to show it can actually do 60 Hz realtime graphics.

Over time, the ecosystem got pretty strong. JVM improved and the performance got better. Life was good.

But something bothered me. Those crazy dependencies, how everything was overcomplicated. Perhaps JVM got too good at optimizing and monomorphizing abstractions away? You didn't have to pay performance penalty for complexity anymore!

Worse, all these layers of dependencies and abstractions made it nearly impossible to actually understand the whole system and figure out root causes for the issues other than by using arguably fairly mature and good tooling available.

All this made me puke. So I stopped coding in Java, maybe 2005 or so. Haven't looked back.

Nowadays I'm happy developing things where Java doesn't stand a chance. Kernel drivers, bare metal firmware, tricky low level stuff, vectorized high performance code. Things that just can't get bloated or they might not work at all.

I don't have strong feelings about JVM much anymore, as long as I don't have to touch it.

JVM's high power consumption bothers me though, we're wasting so many nuclear powerplants worth of power for pretty much nothing. Of course the same is true for many other high level languages.

Perhaps we should work on high level languages with low power consumption?

Re: Java Is Underhyped

#208
post #83
post #78

Earlier quoted context omitted.

Thank you, good point. I forgot about HashMap's type unsafety even though I wrote the following monstrocity a few days ago to loop over a HashMap Iterator ghostI = hashtableNPCs.entrySet().iterator(); while (ghostI.hasNext()) { ExpiringEntityPlayer expiringEntityPlayer = (ExpiringEntityPlayer) ((Map.Entry) ghostI.next()).getValue(); } Apparently this is the only way to do it, and the Map.Entry type absolutely nukes a…

You are supposed to use generics: Iterator > ghostI = hashtableNPCs.entrySet().iterator(); while (ghostI.hasNext()) { ExpiringEntityPlayer expiringEntityPlayer = ghostI.next().getValue(); } However, it's a sham. The generic types are stripped at runtime. The compiler will prevent you from putting values in the map that are not an ExpiringEntityPlayer, as long as you are diligent in using generics everywhere, and don'…

> but you can still be hit by a ClassCastException at runtime if you're not careful.

While it is true the generics are more or less syntactic sugar, I have never seen a ClassCastException due to this in all my years.

Re: Java Is Underhyped

#209
post #175
post #168

Earlier quoted context omitted.

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.

Performance as an issue is massively overstated in high level languages. CPU intensive hot paths are rarer than people think, I/O performance is a bigger deal than people think and there's more hyper optimized code written in performant languages that you can call directly than most people realize.

A lot of graduates think that compsci jobs involve optimizing algorithms or some shit coz they did that type of thing as undergrads, so they port that attitude across.

It's also the reason why pypy was massively hyped for a while and then not really used all that much. It was solving the performance problems python never really had.

Re: Java Is Underhyped

#210
post #80

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…

I agree with you. Actually, Java has great tooling, JVM is very nice, it has great potential for high performance code generation. It has everything for debugging. But at the end of the day, language is driving people to write bloated software. I just wonder, how come e.g Linux kernel code 100 times more readable than any project in Java? More importantly, how did we come to this point that we accept bloated/unreadab…

Linux isn't readable because of C. My god, just go look at the source code of most GNU projects like glibc or gcc if you want to disabuse yourself of that notion.

Linux is highly readable because Linus imposes readability on it through sheer force of will, and because they are willing to sacrifice driver API on the altar of clean code. The result is a very efficient and readable kernel that hardly anyone uses in the environment with the most complex and heterogenous hardware i.e. desktops and mobiles. Android doesn't really use Linux these days. Since some years it has developed its own stable driver ABI that bypasses the kernel for most things.

If all Java codebases were run by a dictator-for-life who could sacrifice trifling details like adoption in order to get the most readable code possible, you'd find you'd like them a lot more too. And a few such codebases are actually like that! Look at the source code of the JDK itself sometime (not the bits by Doug Lea though), or Guava, or really quite a few open source Java projects have readable and nice code.

Post reply on HN