Live data from Hacker News

Java Is Underhyped

jackson.sh

441–450 of 808 posts

Re: Java Is Underhyped

#441
post #256

Earlier quoted context omitted.

> pervasive use of `null` and `Object` Who is pervasively using Object? You are talking about a language that hasn't existed for a decade.

As a simple example, `x.equals(y)` accepts an arbitrary Object y. This one example has ramifications all over the place, e.g. I had a bug recently where I was checking if an element was in a collection, using `x.contains(y)`. That .contains method seems to use .equals, since it allows y to be any Object. In my case x was a collection of MyType values whilst y was a MyWrapper which I forgot to unwrap. Rather than givi…

Yes and also Map's "get(Object key)" and "remove(Object key)". Those are the bane of refactorings, for me.

Re: Java Is Underhyped

#442
post #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.

This is true for JS too, but I never hear as much hate for that language.

Also there are classes of games for which the latency introduced by a GC may not be that much relevant (e.g. strategy or simulation games).

Re: Java Is Underhyped

#443

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…

Minecraft is not successful because of its programming language, it's successful despite the questionable choice of its programming language. Games can be fine and successful withouth being top-notch software, they need to be enjoyable, not performant. Cities:Skylines is also successful, and with decent hardware you get like 40 fps. Again, not its hardware efficiency made it popular.

Regarding modding, I think if the game is successful, then there will be at least a small handful of people that write a modding interface for others.

Re: Java Is Underhyped

#444
post #395

Earlier quoted context omitted.

Your premise is that you are able to chose a language based on how appropriate it is for a specific use case. This alone shows you are not the typical user of Java! Java is typically used in larger or long-lived organizations. It is rare to start new projects from scratch. Most development is maintenance and extension of existing systems. Even if you start a greenfield project, it would be most prudent to chose the s…

> Even if you start a greenfield project, it would be most prudent to chose the same platform and language which is already used in the organization. Anecdotally, I see a trend of greenfield projects moving from Java to NodeJS. I can't think of too many organizations that have zero web presence, and basically any modern web presence requires the use of JS, so there's almost always some JS expertise built into the org…

> there's almost always some JS expertise built into the organization.

That is usually part of the front-end team that don't do the backend SQL work. Tho team that would get assigned the work for a backend greenfield would be versed in Java.

Re: Java Is Underhyped

#445

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 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. Firs…

> 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 think that applies to literally every language. Bad programmers write bad code, regardless of whether it's Go, Java, Python, Bash, or Assembly.

Re: Java Is Underhyped

#446
post #381

This post from "an ignorant computer science undergrad" is pretty silly, so allow me to get a little silly in response. I think if Java's new features are an attempt to woo new developers, Java comes off pretty tragically, like the old guy in the club, trying stay relevant by showing off how it just got up to date with ideas that hit the mainstream ten years ago. Whoa, check out these record classes! Fresh stuff over…

Your metaphors are tiring

Re: Java Is Underhyped

#447

Earlier quoted context omitted.

Nobody has started a project with Ant in the last decade. Of all the Java projects on Github Ant is probably not even 1%. > Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs, You click "Project from existing sources" in IntellIJ and it will recognize both Maven and Gradle projects and just work? Sync the dependencies? configure runtimes and classpaths? What? With Maven and Gr…

I'm talking about a maven project I have to use sometimes at work. Let me walk you through all the shit I had to do: - Install and set the right java version system-wide - Copy some config files for the project system-wide (granted, this is not java specific, but still) - Click in some IDE menu to enable some build settings - Click in some IDE menu to install some "Lombok" plugin - Click in some IDE menu to select th…

I can find maybe only one or two things from this list related to Java, both not reflecting current state of affairs. You do not make the need to have a run configuration a language or platform fault, do you?

Re: Java Is Underhyped

#448

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…

Bedrock is by far the most popular version of Minecraft.

It's the version used on all handhelds and consoles.

Re: Java Is Underhyped

#449
post #362

Earlier quoted context omitted.

I'm talking about a maven project I have to use sometimes at work. Let me walk you through all the shit I had to do: - Install and set the right java version system-wide - Copy some config files for the project system-wide (granted, this is not java specific, but still) - Click in some IDE menu to enable some build settings - Click in some IDE menu to install some "Lombok" plugin - Click in some IDE menu to select th…

IDE's can be fiddly, and anyway I don't think it's good to depend on an IDE for building. The project could have been set up instead with the "Maven wrapper"(1) which provides "mvn.cmd/sh" scripts at the top level of the project to fetch and run the proper Maven. So after cloning the project, all you have to do is set a proper JAVA_HOME if it's not already set, and then do "./mvn clean package" at the top of the proj…

I can (and often do) build from CLI, that is much smoother. I tried using vim on java, but honestly you need an IDE for all the constant code generation and incessant fixups by mouseclicks that are needed. Vim+coc is more than enough in the other languages that I use.

Re: Java Is Underhyped

#450
post #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.

Plenty of things are simpler and easier to read in Scala really: lambdas, constructors, case classes, named and default arguments, for comprehensions, collections, operators on non-primitive types, ...

Sure, you can find libraries using complex type-level machinery, macros and so on. But wading through complex Java libraries that overuse OO design patterns isn't particularly approachable either.

Post reply on HN