Live data from Hacker News

Java Is Underhyped

jackson.sh

221–230 of 808 posts

Re: Java Is Underhyped

#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 something to be said for that amazing stability. I can't think of another language where you can find some .edu page from 2001 with a link to a library (.jar) that does what you need and you can actually use it in a modern application.

Re: Java Is Underhyped

#222

The amount of vitriol Java receives in the game development space is rather strong. However, whenever people dismiss Java as being a bad language, I can't help but think of Minecraft. Yes, it's one of the few mainstream titles where Java has been successfully applied, but I believe Minecraft's success was specifically because it was written in Java. With no JVM, there would have been no Minecraft mods at the level of…

> The amount of vitriol Java receives in the game development space is rather strong.

Java is a language with mandatory GC, tiny objects scattered around the heap (poor locality), and no value types or low-level memory access.

This makes it very poor for games (you know, other very basic ones).

But they're rapidly addressing these concerns.

Re: Java Is Underhyped

#223
post #194

Earlier quoted context omitted.

The crap people created on top was typically responses to deficiencies in the language, whether they knew it or not. Stuff like "everything is a class".

Design design does lead community culture. Java also had the unfortunate destiny of becoming popular at the time where "OOP all the thing" was a mantra in tech circles. Also design pattern were all the rage. Those things have a huge inertia, and while Java is not a much more flexible language, the image stuck, to the point that new comers still implement singletons in the wild.

> Java also had the unfortunate destiny of becoming popular at the time where "OOP all the thing" was a mantra in tech circles.

Java was a product of “OOP all the things”, it wouldn’t have existed without it.

Re: Java Is Underhyped

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

> If you do want to use Java ecosystem, there is Scala.

Scala has a whole slew of problems of it's own. IMHO, Kotlin is where all the Java refugees on the JVM continent are at.

Re: Java Is Underhyped

#225
post #136

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 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 write software in Java. I can't stand python - too wishy-washy.

But my main complaint about Python is trying to use someone else's software. Then it degenerates into a maze of twisty little passages of trying to install the correct set of dependencies, not knowing where those files are installed (which makes it difficult on a cluster, as you may need to do the install on every node separately). Then you try using pip and it fails because some element of what it is trying to install isn't compatible with your operating system for reason 1. So you try anaconda instead, and that fails in a different way, like it runs a C compiler on some file (!?) which fails because $REASON. I have numerous examples of Python software where I have followed the (detailed, precise) installation instructions, and it doesn't work.

Whereas with Java, you just dump the necessary jars into a directory, include them in the classpath, and it works.

Don't get me started on R.

Re: Java Is Underhyped

#226
post #218

Earlier quoted context omitted.

Design design does lead community culture. Java also had the unfortunate destiny of becoming popular at the time where "OOP all the thing" was a mantra in tech circles. Also design pattern were all the rage. Those things have a huge inertia, and while Java is not a much more flexible language, the image stuck, to the point that new comers still implement singletons in the wild.

Java created that hype to market itself. OOP all the things probably wouldn't have been a thing without it, for instance. It was very much a marketed language and a language designed to be sold to top heavy corporations. This fueled a lot of the crappy design decisions, the hype and the culture.

> Java created that hype to market itself. OOP all the things probably wouldn't have been a thing without it, for instance

“OOP all the things” predated (and led to) Java, it wasn’t a product of Java (C++, Objective-C, Object Pascal and, well, a bunch of other things from the late 1980s and early 1990s were where it got started.) Java was about a decade into it.

Re: Java Is Underhyped

#227

Earlier quoted context omitted.

Oh, I'm afraid I can't claim that sobriquet anymore unfortunately. But that's not the point. The point is that, for the 99%, staying on a slower language is ok. For the last 1%, I'll skip Java and go to Rust/Go. If I have to do a rewrite for perf sake, I'm not going to go half way.

But you are not going to get higher performance in Rust/Go.

Rust can literally contain inline asm so yes, you will. But even without that, the startup time is always going to be faster.

And for IO, you will get faster perf in Go more easily. Sure, you can finely tune your Java code to get there, but it's a lot harder.

It in both cases it will eat up way more memory.

There is a reason Google, that did use heavily Java internally, is now moving to Go, a language they custom designed for concurrency.

Re: Java Is Underhyped

#228
post #91

Earlier quoted context omitted.

Stream API allows you to write fluent codes until you met checked exceptions. I wish they had solved this.

Java generics just aren't powerful enough to express that a higher order function's exceptions depend on its args, so pretty much everyone has given up on specific checked exceptions.

Yes, they are:

    @FunctionalInterface
    public interface ThrowingConsumer {
        void accept(T value) throws E;
    }

    public static  void forEach(Collection elements, ThrowingConsumer consumer) throws E {
        for (T element : elements) {
            consumer.accept(element);
        }
    }
There is a significant shortcoming, which is that you can't catch exceptions using the type parameter - this does not compile:

    public static  Optional forEach(Collection elements, ThrowingConsumer consumer) {
        for (T element : elements) {
            try {
                consumer.accept(element);
            } catch (E e) {                 // 
You can kludge your way around that in various ways, but none of them are pretty.

Re: Java Is Underhyped

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

> I remember playing minecraft with friends, and the server was regularly crashing because it was out of memory,

Could be a problem with the logic/design of the server rather than a problem with Java? Despite memory being GC'd, you can still run out of it if you just keep allocating stuff. The important thing about Java is that it doesn't suffer from the usual C or C++ memory exploits.

Re: Java Is Underhyped

#230
post #29
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 write verbose code in any language, but most other languages don't consider it normal to name a class LangDetectLanguageIdentifierUpdateProcessorFactory. (Random example from an open source framework.)

Eh, any sufficiently large or complex codebases will get ridiculously long names at some point. Here are some from a famous C API (Windows):

    CoMarshalInterThreadInterfaceInStream

    D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION 

    RtlWriteDecodedUcsDataIntoSmartLBlobUcsWritingContext
Or how about:

    GtkColorSelectionChangePaletteWithScreenFunc

The alternative is things having names that aren't actually descriptive at all, which is not clearly better.
Post reply on HN