Live data from Hacker News

Java Is Underhyped

jackson.sh

451–460 of 808 posts

Re: Java Is Underhyped

#451
post #112

> Java is fun to write, productive What the hell? I don't think we have the same definition for any of these words. I know Java has changed quite a bit since Java 8 (Java 9 being the last version I used professionally before switching completely to Go), but I just can't write Java again, it's physical. When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts. Not t…

I agree that Java isn't fun or productive, but I'll qualify that statement with "for me".

I really do believe that the reason we have programmer holy wars is because we approach problem solving in different ways.

The way I approach solving a problem with a computer program is almost incompatible with the Java programming language. And, no- this is not a thinly veiled way to shit on object oriented programming. I can work in an object oriented paradigm just fine. It's just Java specifically that doesn't work for me.

Here are some examples that constantly bother me when writing Java:

* Null. Enough said.

* Writing value types used to be very tedious and bug-prone before Records. I haven't written Java with Records yet, but I'm glad to know that they'll be there if/when I do Java again. Even for an object-oriented architecture, value types can be useful and I use plenty of them.

* Type erased generics are painful. Especially with interfaces.

* The number and arithmetic APIs are incredibly frustrating. No unsigned numbers, silent wrap-around on overflow, silent data truncation on casts, etc. I have zero confidence that my Java code that deals with numbers is robust at all.

I'm sure that many programmers don't even notice these things, because they way they interact with program design is just different than my way. But when I write Java (or mostly any JVM language) one or more of these issues are on the forefront of my mind with almost every single line of code I type. It's almost unbearably frustrating.

Re: Java Is Underhyped

#452
post #407
post #400

Earlier quoted context omitted.

I also don't understand where is the "fun to write" aspect exactly that the author insists about. "This cannot be understated: Java simply feels good to write" But why? The only explanation that follows is that "a lot of this is due to the craftsmanship JetBrains puts into IntelliJ IDEA. Everything is autocompleted, jump-to-definition is fast, find-usage works well, and refactoring is easy" . I too think that IDEA is…

> I too think that IDEA is an excellent IDE, but why should Java take the credit for it. If anything, the more it needs an excellent IDE in order to feel pleasant, the worse it says about the language itself. It actually does, the language itself makes those features possible. The reason javascript does not have as good IDE is that language itself stands in a way.

You mean by having a (not very powerful) static type system and constructs that serve as name spaces for auto-completion lookup. Any language with modules and a static type system supports this, if the effort is put into creating the tools.

Re: Java Is Underhyped

#453
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".

I don’t think that’s true at all. Like most languages, Java has its share of deficiencies - I’d personally put null handling, type erasure and brain dead Optionals near the top of my list of things I’d change if I was King of Java - but fluent APIs and factory methods didn’t even start with Java, and have nothing to do with “everything is a class”.

What is wrong with Optionals?

Re: Java Is Underhyped

#454
post #222

Earlier quoted context omitted.

> 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).

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

Really? https://www.google.com/search?q=JavaScript+is+the+worst+lang...

If it exists, some people hate it. If it's popular, most people hate it. It's a universal law. /s

Anyway, you never hear "JS is not suitable for high-end games" because with JS that's kind of self-evident. While with Java, some people don't know enough to realize that.

> 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).

Strategy/simulation games can get quite big/complex. Keep in mind you're not just modeling the units, but also the terrain the various particle effects and so on. You can definitely pull off something like StarCraft 1. But people want games to match the capabilities of their hardware, not that of a Pentium from the 90s.

And performance remains crucial on mobile. I.e. you may get the game going, but it'll suck your battery empty in record time.

Re: Java Is Underhyped

#455

Earlier quoted context omitted.

>When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts. Like, if you're out of work for a couple of months and the only way to feed your kids is to take a Java job, I don't think you'd pass it up. I wouldn't pass it up either even though I don't like Java. The whole language feels like it's designed to meet some minimum lines of code requirement. If you're worki…

If starving is the only reason to take a Java job then it doesn't exactly speak for it. Python, for example, is also strongly typed. You most likely mean static typing, which is very useful but not exactly Javas or Cs strong suit either.

Yeah, Static typing. In C# I swear this the only reason I can get anything done( Visual Studio's auto complete is nice).

Most people basically work to eat, I've taken Java jobs just because I needed the work. It can always be worse.

Re: Java Is Underhyped

#456
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.

Pre-setting max memory seems odd these days, when everything runs in docker, with its configurable memory limits.

Handling process memory usage pre-docker wasn't so easy.

Re: Java Is Underhyped

#457
post #186

Earlier quoted context omitted.

Long term, Kotlin will only stay relevant on Android. They cannot fully embrace the JVM while targeting ART, JS and native at the same time.

With respect, you're wrong. I say this because we're now seeing widespread adoption of serverside Kotlin at places like Google and Amazon. With the support of Google and Jetbrains they can target whatever they want.

With respect, welcome to the Kotlin version of #ifdef, where language features depend on the underlying runtime.

That 3D graphics library using SIMD and value types from JVM on ART or JS?

Good luck achieving the same perfomance and memory semantics.

Kotlin/Native has already been rebooted as its memory model was incompatbile with JVM libraries.

Re: Java Is Underhyped

#458

Earlier quoted context omitted.

You use Java because it is low risk. I think it might be lower risk than any other language in terms of design patterns, hiring, library support, run-time surprises, etc. The language itself isn’t great though. Java solutions tend to be bloated and make it hard to decipher the underlying domain logic. I certainly wouldn’t pick Java for a small team of experienced developers.

I agree that Java is low risk from a manager responsibility perspective: nobody has been fired for choosing it for a long time. Now, from a project success perspective, I think it's not. I've seen a lot of Java projects fail, over engineered, full of spaghetti code, riddle with inscrutable abstraction, stuck in a glue of badly designed architecture that has been fossilized by the type system. I'd say from a project r…

I have seen a lot of projects fail over the years, for many different reasons, but I have never seen a project fail due to the choice of programming language.

> I've seen a lot of Java projects fail, over engineered, full of spaghetti code, riddle with inscrutable abstraction, stuck in a glue of badly designed architecture that has been fossilized by the type system.

Sure, but do you really think the same organization would have produced perfect simple elegant error-free code is Haskell or Smalltalk (or whatever "better" language you are comparing to) under otherwise same requirements, deadlines, resources and management?

I'm not saying languages doesn't matter. A better/more appropriate language is like having a bigger screen or a better chair. All else being equal, it will increase productivity and make developers happy. But it will not make or break a project. The things that will break the project: Bad/unclear specifications, bad management of change requests, lack of testing, unrealistic scheduling, lack of customer feedback, bad communication or conflicts among developers.

Re: Java Is Underhyped

#460
post #120

Earlier quoted context omitted.

You just install any JDK in any directory - nothing to configure there - and then point IntelliJ to this directory... If this is hard, then... hmmm....

Acting like Java tooling isn't more difficult than other languages is dishonest. Starting with a Java project is considerably more complex than with most other languages. "Missing manifest" or issues with classpaths are not intuitive.

Ok I'm super sympathetic to how annoying it is to manage JDKs, but holy hell it's not like Python tooling (for example) is a walk in the park. Are you using system python? Is it pip, with it's constantly breaking upgrades, or poetry, which isn't necessarily production ready? Do you have a virtualenv? Pipenv? How do you package it?

Java tooling can be painful but to me it's VERY squarely middle of the road.

Post reply on HN