by thiht · 5y ago · 0 comments
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 to mention the pain point that it still is to install and configure a JDK, and make it work properly with Intellij, why is it still so complicated?
Then there's Maven and Gradle that are just... bad, I have no other phrasing. I hear a lot of people saying Maven already solves all the problems we have with today's tools but that's just not true, even the entire Maven stupid lifecycle should be thrown away!
I used to work for a company that had about 100 different Java web applications running, each with their own JDK. It was _trivial_ to set up and maintain. Was it wasteful? Sure. I shipped a JDK with each application. Was it hard to automate? No. Basic deployment automation made it trivial. The JDK was just an application artifact alongside the JAR file, and the application starting script set JAVA_HOME pointing to it for that process.
IntelliJ makes it trivial to maintain a project specific JDK. You just add the location of your JDKs to it (IIRC it can even auto-populate the list), and then choose the JDK from a simple menu within the IDE.
I used to be a C++ wizard. I did things with that language that were just unspeakable. I used features so obscure that I don't even know if they have an official name.
Then after I dunno... the five hundredth nonsensical linker error, something in me just snapped and I just can't ever go back there.
IDEA can download and configure one of multiple JDK distributions in a single command:
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.
"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 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 really looks to me like the "ignorant computer science undergrad" mainly worked with JavaScript (having only dabbled with C++ and a few other languages as part of his uni courses), and got excited by discovering a proper IDE and a statically typed language that happens to have a low entry threshold.
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.
The large the project, the bigger the gap gets.
I've never seen a Java program in my entire career that was actually fast and not a huge pain to work with. I'm working on a new one right now and the prototype/skeleton literally does just basic CRUD operations and the CI/CD pipeline takes 7 minutes.
Golang was a breath of fresh air for me.
You can put it another way and say it doesn't feel good to write Java without JetBrains.
You just download the JDK, and set JAVA_HOME to point to it when you want to use it.
For IntelliJ, you set the JDK in the project settings. It has a menu where you can point it to a JDK it knows about already, a JDK on your FS, or you can select a JDK for it to download for you. Couldn't be easier.
Java build systems are mostly terrible - you're right about that. Maven has the best tooling support, and is actually very straightforward, but a bit limited. I have had a number of bad experiences with Gradle. The Blaze-family build systems (Bazel, Buck, Pants, Please, etc) are far more sane, but have low adoption.
Where’s the pain?
I have been in situations where I had to compile some projects from other people and it has been painful every time. Especially as I might be in an environment where there are no IDEs that wrap things up for you.
Everyone has different experiences and requirements for their projects and not everything is same as it is for you. Don't take it personally and try to passively insult other people's intelligence.
tar -xzvf <jdk archive>
<set JAVA_HOME env var to point to dir>
<add to PATH $JAVA_HOME/bin>
So complicated.
As for amounts of scaffolding, IntelliJ product writes it for you. And modern Java forces you to write only a half of it anyway.
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 working on a team, strongly typed languages like Java and C sharp are a must. Otherwise it can get extremely hard to figure out what exactly other people are doing.
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.
Most people basically work to eat, I've taken Java jobs just because I needed the work. It can always be worse.
I would honestly consider the alternatives. I'd probably take it in the end because money is good, but I'd try to flirt with manual work instead, if Java was my only option.
Eh. 150k working on Java enterprise systems vs working at Costco for 15$ an hour. Java isn't great, but it's still much easier than C or C++ imo.
In a perfect world we could all work in Python all day, but that's not life
Other languages have other pains, for example I have physical revulsion against the version management hacks for python or ruby (rbenv and stuff like that - somehow hacking environment variables on the fly to manage multiple installations of the language).
Two years ago I wrote a small web app in Python and I found hosting very complicated, compared to Java. PaaS exist but are very expensive.
More seriously, IDEs exist and work, so if people are productive with them, what does "but you'd be less productive if you didn't have your IDE!" gain us? C++ is a bit less verbose, but still the wide majority of devs uses an IDE with it because it does useful things. Programmers of Lisp etc use editors that have tools to edit Lisp files better. etc. I get not liking the existing options as a matter of personal taste, but that's different.