News for hackers. Stuff that matters.
Re:Java Is Underhyped by thiht on Friday April 16, 2021 @03:40AM (#26830775)
> 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 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!

Re:Java Is Underhyped by Twirrim on Friday April 16, 2021 @04:35AM (#26831205)
> 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?

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.

Re:Java Is Underhyped by jiggawatts on Friday April 16, 2021 @07:11AM (#26832422)
You just described how I feel about C++

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.

Re:Java Is Underhyped by omginternets on Friday April 16, 2021 @09:35AM (#26833677)
It seems like grappling with these arcane features feels productive, at first. You enter a flow state and after a while, something works that didn’t work before. It’s only when you step back and ask what actually got accomplished that you realize it’s time wasted.
Re:Java Is Underhyped by scaladev on Friday April 16, 2021 @04:32AM (#26831177)
>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?

IDEA can download and configure one of multiple JDK distributions in a single command:

https://www.jetbrains.com/help/idea/sdk.html#jdk-from-ide

Re:Java Is Underhyped by ragnese on Friday April 16, 2021 @10:01AM (#26833966)
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 by V-2 on Friday April 16, 2021 @09:15AM (#26833469)
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 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.

Re:Java Is Underhyped by watwut on Friday April 16, 2021 @09:22AM (#26833545)
> 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.

Re:Java Is Underhyped by dunefox on Friday April 16, 2021 @10:02AM (#26833977)
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 by blacktriangle on Friday April 16, 2021 @12:03PM (#26835596)
It's a bit of a "stop hitting yourself" situation. Java features make awesome tooling possible, but awesome tooling is necessary due to some really bad features of Java. So I don't care if a different language has worse tooling when it also does not have the problems that Java has that the tooling solves.
Re:Java Is Underhyped by watwut on Friday April 16, 2021 @03:05PM (#26837812)
The result of that tooling is better. It is easier to read, navigate, refactor and write then supposedly superior language without tooling.

The large the project, the bigger the gap gets.

Re:Java Is Underhyped by scottious on Friday April 16, 2021 @08:38AM (#26833119)
Totally agree, especially about Maven/Gradle. I'd also like to point out that the popular Spring Framework is just... annoying. It's full of magic. You have to know the right incantations to get anything done. Somehow there is too much documentation and not enough at the same time.

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.

Re:Java Is Underhyped by stunt on Friday April 16, 2021 @07:03AM (#26832339)
> Java simply feels good to write. A lot of this is due to the craftsmanship JetBrains puts into IntelliJ IDEA.

You can put it another way and say it doesn't feel good to write Java without JetBrains.

Re:Java Is Underhyped by oftenwrong on Friday April 16, 2021 @10:29AM (#26834324)
>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?

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.

Re:Java Is Underhyped by twic on Friday April 16, 2021 @05:02AM (#26831389)
Installing a JDK is trivial. What do you mean by "configure" a JDK? You mean tell your IDE it exists? Wow.
Re:Java Is Underhyped by Nursie on Friday April 16, 2021 @03:53AM (#26830871)
On my new air I installed IntelliJ and brew-installed Java. It all works.

Where’s the pain?

Re:Java Is Underhyped by thiht on Friday April 16, 2021 @03:55AM (#26830881)
Wait for updates or projects requiring a different JDK.
Re:Java Is Underhyped by pulse7 on Friday April 16, 2021 @04:03AM (#26830944)
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....
Re:Java Is Underhyped by eurasiantiger on Friday April 16, 2021 @08:36AM (#26833099)
That is a perfect demonstration of the toxic attitude I’ve come to expect from Java fanatics.
Re:Java Is Underhyped by pulse7 on Friday April 16, 2021 @09:46AM (#26833798)
I've just written an argument which can be verified. If you call me a "fanatic" because of writing a provable argument I can at least say I have a freedom of speech...
Re:Java Is Underhyped by eurasiantiger on Friday April 16, 2021 @10:47AM (#26834540)
I did not mean to make a judgment on substance, rather I made an observation about tone that seems to reflect a disagreeable personality. Would you agree?
Re:Java Is Underhyped by pulse7 on Friday April 16, 2021 @02:15PM (#26837302)
I submitted a >>single<< disagreement, so please don't generalize this into a "disagreeable personality". Please provide opposite arguments - for example some facts that show how complicated it is to setup new JDK in IntelliJ... such arguments will improve quality of discussion here...
Re:Java Is Underhyped by spentu on Friday April 16, 2021 @12:24PM (#26835887)
People tend to forget that everything seems easy when you know things.

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.

Re:Java Is Underhyped by pulse7 on Friday April 16, 2021 @02:10PM (#26837240)
The parent said "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?" It is NOT complicated. Everybody can try this out. But if the parent had these problems on some specific project where thigs were messed up, he should not generalize these problems from a specific project to every Java project... Everybody can install a fresh IntelliJ IDEA and fresh JDK - and see that this is easy and not complicated at all.
Re:Java Is Underhyped by dunefox on Friday April 16, 2021 @09:25AM (#26833569)
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.
Re:Java Is Underhyped by WatchDog on Friday April 16, 2021 @10:41AM (#26834468)
Building a standard maven or gradle project is substantially easier than most other languages, in my experience.

I don't have to setup a $GOPATH, downloading dependencies doesn't kick off a million scripts that end up running native compilers, like in the node/ruby/python/php ecosystem. I can build and run a Java project on almost any system, without making substantial changes to my environment and without giving up and using docker for my dev environment.

Re:Java Is Underhyped by Nursie on Friday April 16, 2021 @09:50AM (#26833845)
"gradle init --type java-application"

Honestly I haven't had to deal with the issues you talk about in the last five years (which is as long as I've been writing java commercially, before that I was mostly a C developer).

Having had recent experience with Go and Javascript/Node, I can't say either struck me as especially easier or more intuitive to get started with.

Re:Java Is Underhyped by dunefox on Friday April 16, 2021 @10:16AM (#26834161)
Most likely because you have dealt with them many times before that you don't notice them anymore or prevent them in the first place while setting up a project. But everytime I need to do something in Java I get bitten by this stuff, and I'm not the only one.
Re:Java Is Underhyped by Nursie on Friday April 16, 2021 @10:48AM (#26834556)
I've never had to, was my point. Not since waaay back in the day when I was first learning about it (more than 20 years ago). I came to java (commercially) 5 years ago, and it's not that I've dealt with it so much I don't see it, I've never had to deal with it.

Maybe things have got much better in the last handful of years, I don't know. My experience of getting started with a java project in that time has been no worse (and not really any better either) than in other languages.

Re:Java Is Underhyped by blandflakes on Friday April 16, 2021 @10:08AM (#26834070)
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.

Re:Java Is Underhyped by dunefox on Friday April 16, 2021 @10:24AM (#26834254)
I agree, Python is horrible. And I don't even like the language itself much. I like Julia, for example - although packaging there isn't great either.

My problem is that Java is one of the (probably) 3 biggest languages in use, both investment and dev time wise, and it's overall just not that great.

Re:Java Is Underhyped by blandflakes on Friday April 16, 2021 @10:35AM (#26834383)
I honestly wish I knew what was better - it's not like I've ever used a build tool I didn't hate in some way. Part of the problem with Java to me is that (IMO) maven is the only build tool that doesn't make force me to spend significant time maintaining the build as well as the code, but maven is... very much a local maximum.

I generally agree with "not that great" - Java the language I actually find fine, and to me it scratches a lot of the pragmatism that Go tries to get, with different warts in each. I try to avoid the Java framework ecosystem so I don't have to deal with beans and annotations and piles of codegen, not because I don't like the language. And Android has done much damage to the community's impression of Java.

Re:Java Is Underhyped by wing-_-nuts on Friday April 16, 2021 @11:00AM (#26834713)
Then you use something like jenv or an alternative
Re:Java Is Underhyped by vips7L on Saturday April 17, 2021 @08:54AM (#26843884)
SDKMan
Re:Java Is Underhyped by sto_hristo on Friday April 16, 2021 @04:22AM (#26831101)
curl -OL <jdk url>

tar -xzvf <jdk archive>

<set JAVA_HOME env var to point to dir>

<add to PATH $JAVA_HOME/bin>

So complicated.

Re:Java Is Underhyped by hurril on Friday April 16, 2021 @04:25AM (#26831137)
All your projects are belong to that one version of the JDK. Great success.
Re:Java Is Underhyped by sto_hristo on Friday April 16, 2021 @04:43AM (#26831265)
No success is greater than 100 different projects needing 100 different JDKs on the same machine. But somehow i don't have a problem building an android app in its own java, while the backing service is done in a completely different jdk. It's not ideal as i would want the latest language features in the android side, but that is an android problem.
Re:Java Is Underhyped by hurril on Sunday April 18, 2021 @04:33AM (#26850805)
My point is that you do not simply update PATH and JAVA_HOME these days. That was Java 1.02 or somesuch roughly a hundred years ago.
Re:Java Is Underhyped by hamilyon2 on Friday April 16, 2021 @07:21AM (#26832500)
Ideas in the foundation of maven are old, but that is the only complaint I have with this tool. Problems it solve are not new either.

As for amounts of scaffolding, IntelliJ product writes it for you. And modern Java forces you to write only a half of it anyway.

Re:Java Is Underhyped by kaba0 on Friday April 16, 2021 @11:49AM (#26835396)
You actually went to Go and say that java is painful to write? Wth?
Re:Java Is Underhyped by offtop5 on Friday April 16, 2021 @07:35AM (#26832606)
>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 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.

Re:Java Is Underhyped by dunefox on Friday April 16, 2021 @09:28AM (#26833602)
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.

Re:Java Is Underhyped by offtop5 on Friday April 16, 2021 @10:04AM (#26834015)
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 by thiht on Friday April 16, 2021 @10:28AM (#26834311)
> 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 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.

Re:Java Is Underhyped by offtop5 on Friday April 16, 2021 @10:37AM (#26834407)
>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

Re:Java Is Underhyped by McScroogy on Friday April 16, 2021 @07:01AM (#26832331)
I used to feel like you, but I have come back to Java.

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.

Re:Java Is Underhyped by dmingod666 on Friday April 16, 2021 @08:12AM (#26832896)
"fun to write" give them IDE-driven-developers a text editor and see how much "fun" it is.
Re:Java Is Underhyped by detaro on Friday April 16, 2021 @08:16AM (#26832929)
"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 by dmingod666 on Friday April 16, 2021 @08:31AM (#26833060)
I can't think of one other major programming language that relies so heavily on the IDE to do the development work, can you?
Re:Java Is Underhyped by detaro on Friday April 16, 2021 @09:48AM (#26833815)
LabVIEW ;)

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.

Re:Java Is Underhyped by slver on Friday April 16, 2021 @11:45AM (#26835317)
Let's assume it is. So what?
Re:Java Is Underhyped by gher-shyu3i on Wednesday April 21, 2021 @09:22PM (#26897552)
Any non-trivial program will require an IDE, regardless of language.
Re:Java Is Underhyped by panzerboy on Friday April 16, 2021 @01:36PM (#26836847)
C#
Re:Java Is Underhyped by metaltyphoon on Friday April 16, 2021 @01:53PM (#26837052)
That’s not even remotely true
Re:Java Is Underhyped by eurasiantiger on Friday April 16, 2021 @08:40AM (#26833142)
OOPHP.
Re:Java Is Underhyped by dmingod666 on Friday April 16, 2021 @09:26AM (#26833574)
lolz! had to google that one.
Re:Java Is Underhyped by slver on Friday April 16, 2021 @11:44AM (#26835290)
Give them text-driven-developers a magnetic needle and a hard drive and see how much "fun" it is!