Live data from Hacker News

Java Is Underhyped

jackson.sh

331–340 of 808 posts

Re: Java Is Underhyped

#331

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…

I came to say say that's not a language problem, that's a packaging problem. But that would be misleading. The reason packaging is still a problem in Python are linked to the language: - to get perfs, you need compiled extensions, which java doesn't need. So a Jar can be fast and portable, while in Python it's an "or" proposition. Wheels help, but they still are OS dependent, so you need a build per OS. - PYZ arrived…

Is shiv better than pyinstaller? When turned my script into a binary with this, it took 10 seconds extra on every execution just to start running the script (Eg to just print the help message). I found that to be unbearable since this was a command line script that was invoked anew for every execution

Re: Java Is Underhyped

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

"fun to write" give them IDE-driven-developers a text editor and see how much "fun" it is.

Re: Java Is Underhyped

#333

Earlier quoted context omitted.

I came to say say that's not a language problem, that's a packaging problem. But that would be misleading. The reason packaging is still a problem in Python are linked to the language: - to get perfs, you need compiled extensions, which java doesn't need. So a Jar can be fast and portable, while in Python it's an "or" proposition. Wheels help, but they still are OS dependent, so you need a build per OS. - PYZ arrived…

Is shiv better than pyinstaller? When turned my script into a binary with this, it took 10 seconds extra on every execution just to start running the script (Eg to just print the help message). I found that to be unbearable since this was a command line script that was invoked anew for every execution

If you're not already using the --noupx flag for pyinstaller, you can probably cut that startup latency at least in half. With UPX enabled, the executable has to be decompressed every time it is called. The space saving tends to be minimal and not worth it, definitely not for a CLI where startup latency much more directly impacts the user experience.

Re: Java Is Underhyped

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

"fun to write" give them IDE-driven-developers a text editor and see how much "fun" it is.

"Don't let them use the appropriate/preferred tool for the job and see how much fun it is" is a fairly nonsensical proposal for pretty much every profession.

Re: Java Is Underhyped

#336

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…

My main issue is that people writing Java (or for the JVM) because of their backgrounds (app-level code printers) almost completely disregard how that code works on the JVM, at scale, in a highly responsive and/or high throughput service. You can't just use a big, "safe bet" framework like spring, which taints EVERYTHING in that project, write a simple REST API and then do heavy work "in the background" without side effects.

"Running Java" requires detailed system engineering / ops expertise specific to how the JVM works and can be tuned, and all too often, how specific frameworks internally pile their abstractions on top of each other. Problem is, a modern "Java app" is a pile of large frameworks and libraries.

As a system engineer, I HATE Java applications written by clueless programmers. They are difficult to handle and I often have to dig in and fix bad usage of framework features that somehow passed code review by equally clueless "senior" developers. I then get to spend a day to find out why this or that connection pool in there managed by this or that library does not handle its connections correctly, just to find the magic framework level variable that tunes that specific screw. Stuff of nightmares.

Every Java project is also __severely__ underdocumented. That's because even if you write documentation for YOUR code, the framework has books of documentation on ITS specifics, and includes high-level libraries which THEMSELVES have heaps of specific documentation. Climbing the tree until one arrives at actual standard library calls is like climbing into clouds and hoping to see the sun some day.

Re: Java Is Underhyped

#337

Earlier quoted context omitted.

Java is so much worse on this front. > with Java, you just dump the necessary jars into a directory, include them in the classpath, and it works. Ant, maven, or gradle, and then some jars, somewhere? What's the classpath and whats $JAVA_HOME for this project? Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs, sync the build system, sync the dependencies, configure runtimes an…

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 the right jdk
  - Click in some IDE menu to edit the run configuration:
    - select main class
    - paste program args
    - paste env vars
    - select right “Use classpath of module:” option
  - Click in some IDE menu to fiddle with "Spring Loader path": modules, dependencies, reorder the dependencies (!)
  - Click in some IDE menu to configure getting the actual logs
  - Click maven-sync, rebuild-project multiple times, restart IDE until it suddenly works
The first guy who got it to work had to write a guide with screenshots!

I know you will say, this is all fault of whoever made this crap project, or my fault for not fixing it. However this was my experience, and it has been similar every time in my life that I had to touch some java project (although this last one is the worst).

Re: Java Is Underhyped

#338
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 used Kotlin in a large codebase, and one of my only complaints is the compile times. We use Gradle for our build system, and relative to Java it is slooowwww. But we like the other benefits of Kotlin, so it's worth it in the end. But if they could get compile times down, it'd be the perfect language imo.

Re: Java Is Underhyped

#339
post #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 s…

My experience with C# is similar. It was always designed to be a Java clone, and Microsoft is well-known for their backwards compatibility. I once wrote an application in 2005 that kept running with unmodified source code up until 2017 in production across multiple operating system upgrades, database upgrades, and a transition from 32-bit to 64-bit runtimes.

And then they decided to end that line of succession. .NET Framework 4.8 is the last version of the framework. I've started experimenting with converting code to .NET 5, but it's a rather large jump compared to any previous upgrade. Going from 2.0 to 4.0 had a few minor hiccups, but going to .NET 5 is basically a rewrite of the framework and runtime, and I'm not sure how old and new assemblies will co-exist. It feels like a fragmenting of the ecosystem, where a bunch of code will be stuck on .NET 4 forever, and other code will move to the .NET 5 and later.

I'm almost expecting a few years down the road, Microsoft will go back on 4.8 being end-of-the-line for .NET 4 and start releasing new minor versions of it because of all the customer code that can't be ported to .NET 5. Or maybe it will just end up like VB6. Stuff written in it still works, and will continue to work, but it's considered a dead language.

Re: Java Is Underhyped

#340

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…

I came to say say that's not a language problem, that's a packaging problem. But that would be misleading. The reason packaging is still a problem in Python are linked to the language: - to get perfs, you need compiled extensions, which java doesn't need. So a Jar can be fast and portable, while in Python it's an "or" proposition. Wheels help, but they still are OS dependent, so you need a build per OS. - PYZ arrived…

>the Python community is at least half composed of amateurs.

or, even worse, scientists.

Post reply on HN