Live data from Hacker News

Java Is Underhyped

jackson.sh

781–790 of 808 posts

Re: Java Is Underhyped

#781
post #607

I feel like the arguments would've been better applied to kotlin (especially with IntelliJ). Java has two big problems: Null and boilerplate code (getters, setters etc.) which messes with code coverage (and no, lombok is no appropriate solution to this). Kotlin is pretty null safe and has very little things which we cannot properly test. The language is easy to learn and fun to write. It feels sleek, modern and you n…

Having 100% code coverage just because is not meaningful in itself, so I don’t see your point. Having 100% is just as not enough because you can arrive at a line of code from exponentially many states. Mutation testing is a good way to show whether the tests are actually worth anything.

You misunderstood me. You would need to add tests for getters and setters to guarantee that there's no typo in there (I've seen quite some bugs due to this) but it feels like a waste of time. That's why I'm happy that that's not necessary with kotlin.

Code coverage is just a control tool.

Re: Java Is Underhyped

#782
post #585
post #325

The ultimate problem with Java (and OOP too, even in the Kay's sense) is that its philosophy represents a very paternalistic approach to software development. The idea is here are these things called objects, you can't look into them, and you only have to use them the way they are designed; under no circumstances you can break them down into internal components and remix those freely. In Java, this overall approach m…

I think you mistake general Objects, and their sub”class” data objects. Data oriented design is popular now, but it is just a subcategory. As a base, OOP is really great, class invariants and encapsulation is the only effective weapon against complexity (and software engineering is largely about managing complexity). Data classes that expose their internals are a great way for some program logic, but let’s say a data…

Actually, "data-oriented design" is very old, if you look how some old COBOL apps are written, what JCL was about, etc.

But I think you completely missed my overall point about being patronising, meaning, the idea that the author of the language/library knows better than the user of the language/library. The reason why Java is so guilty of this is that its other competitors at the time (C++, Common Lisp, Python) at least acknowledged other paradigms than OOP, and were not so fundamentalist about it.

(Smalltalk is a notable exception, but it is not as patronising in other ways as Java is. But in general, OOP tends to be patronising because its central tenet is that the definition of the object should alone determine its properties, they shouldn't be changed/imposed from the outside. Which is a good rule of thumb, but sometimes in practice becomes an obstacle.)

Re: Java Is Underhyped

#783
post #73

I do think Java has a bad rep as a "dry, corporate, enterprise" language, but I think there is an ecosystem around Java that is pretty awesome and you can build incredible applications with Java if you want to. Java has a branding problem. Java (and Oracle) missed the wave of the last 15 years when tech became "cool." If you were new to tech/programming and wanted to pick up a language, which of these three would you…

I actually laughed out loud at the Java.com homepage. I was so surprised, I expected a sleek, modern homepage but instead I got a portal to 2010.

> I actually laughed out loud at the Java.com homepage. I was so surprised, I expected a sleek, modern homepage but instead I got a portal to 2010.

The Java download button looks clickable without me having to hover over it. The Kotlin "get-started" link doesn't look clickable, because it's next to a different link that has a different style (both actually are clickable). The Scala one has a download link that also doesn't look clickable.

Rubbing salt into the wound, if you click on the second link for Kotlin ("learn more"), the back button doesn't work.

Summary

Java website: made as obvious as possible, prominent download and search interface on main page; type in your search and press enter.

Kotlin: Links differ in appearance from each other, back button broken for some links, which don't even look like links. Cannot type in a search term until after visually finding and clicking a search icon. Then you type in your search term (two-step process).

Scala: download link looks like neither a link nor a button. Never found a search button. At least "Back" works.

I have to say, the Java landing page works best. That your personal preference is for less obvious and less simple user interfaces doesn't make the simple and easy to use interface a bad choice.

Re: Java Is Underhyped

#784
post #402

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…

I think the problem is because of the virtual machine, instead of being compiled to an executable. I mean GraalVM is great - but why did it take so long to develop? I mean Sun could still be alive if developers and users had instant startup times, could have easily deployed Java to servers and clients, and that it was not only faster but used way less memory.

> I think the problem is because of the virtual machine, instead of being compiled to an executable.

I learned Java on gcj (gcc support for Java), and it generated executables. I've no idea why they killed it. Maybe someone more in the know can explain.

Re: Java Is Underhyped

#785

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 also a prime example for why Java is bad for game development.

The GC is constantly overworked because Java has to allocate immutable vector and matrix classes on the heap.

In other languages (like C# for example) you'd make that a struct and enjoy value type semantics and stack allocation (in most cases).

Re: Java Is Underhyped

#786

Earlier quoted context omitted.

How large is the codebase? I moved to kotlin from scala and find the compilation to be rapid in comparison. Fwiw, I’m normally on a beefy desktop so I might just be brute forcing this issue.

11,503 files, 1,431,195 lines of code. (spread out over I think the main problem is that Gradle doesn't have the same support as Java for ABI compatible changes, so invalidation of modules are more common.

This article points to ABI as an open optimization problem in kotlin:

https://blog.jetbrains.com/kotlin/2020/09/the-dark-secrets-o...

I think you're right - ABI compatible changes are likely the culprit.

Re: Java Is Underhyped

#787
post #525

Earlier quoted context omitted.

The complexity of maven is well understood and battle tested. The complexity of a custom build is not. In my opinion it is of a far more concerning sort of complexity.

It's an Ant build file - nothing complex at all. If you no or few dependencies and are comfortable managing them manually, Ant is fine. Non-networked applications don't tend to need to be so paranoid about keeping up to date with the latest versions of dependencies.

We're probably optimizing for different things. I'm normally optimizing for easy onboarding of someone new. If this is a personal project with few dependencies then ant is probably good enough.

Re: Java Is Underhyped

#788
post #328

Earlier quoted context omitted.

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 p…

Most python software use the standard venev setup with pip and requirements.txt, and most java software are distributed as fat jars. Nobody manually sets up dependencies anymore. As a Java/Python/Go developer I can say that packaging is a solved problem as of 2021.

That's really not true.

I like to point out Airflow as an example. It's still a complete nightmare to deal with and it has many steps for just packaging the application.

https://github.com/apache/airflow

I have less trouble packaging and running a 3 year unmaintained Maven Java application, than actively maintained Airflow. And let's not forget that I can target Java 8, without having to install Java 8 on my machine. (Which only adds to Python's complexity)

Re: Java Is Underhyped

#789
post #617

Earlier quoted context omitted.

Well, it does considerably more things than a hello world python app. So at least compare it to Python’s full blown backend server with ORM and the like.

Django: zero dependencies for years, you could literally copy paste the code and it worked, ORM included. It now has 2 dependencies. It is a 1000 times easier to use than hibernate, despite being one of the worse ORM in Python. That the problem with old Java libs like Swing or Hibernate: they have been designed for the 90' and don't leverage the potential of what a modern Java version can do.

Pointing to Swing or Hibernate is akin to pointing to GoLang of 2012 or Python of 2001.

Re: Java Is Underhyped

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

The problem with Python today is that it only plays nice with C... which is a problem, since it's integration with JVM is probably more important today than 10 years ago.(Spark, Hadoop, etc)
Post reply on HN