Why Does Nobody Want to Learn Java in 2022?
makeuseof.com
makeuseof.com
The fact that it is associated with one of the most scummy companies in the planet doesn't do the language any favours.
A second data point is: other languages improved enough, Java is just another one among many. There's nothing unique about it.
To me, C# not only caught up with Java, but also overtook it and left it miles behind. Developing services with .NET Core is an absolute pleasure, and feels so effortless.
Beyond tradition and legacy code, what does Java have to offer?
I don't want to touch anything associated with Oracle, because that company is predatory.
Ask companies whose employees made the mistake of installing VirtualBox plus the extension...
Java is not feasible to work in that world. JVM is too heavy to do that.
Modern languages like Go are much better for that. If I recall correctly soon half of all new projects will start as a Go project.
How long will it take to scale out?
How easy it is to write event driven architecture, can ppl pick up the code in two days and become efficient?
Java has issues that other languages requiring a bit more grunt work dont have.
I recently tried Java, and attempted to use Spring Boot, EE, Jetty, etc, to setup a small service-oriented cloud app, and I must say, the barrier to getting it up was a more effort than compared to the ecosystem of Node, Deno, Python. Even the package manager Gradle was not as quick of an effort as other PMs.
But then I found Javelin, https://javalin.io/
This is a much better framework to get up and running quickly with Java, especially with my background using Node. But the effort finding this was substantial, it is not widely broadcasted. Tomcat seems to be the dominant path, but I feel Tomcat is overkill for a small, personal use case where I just want to try some ideas out.
Even after finding Javelin, I still found some resistance to getting the classes to work together and getting it properly bundled.
I should also note I'm not interested in the IDE automation scripts that do everything for me (a few YouTube Java tutorials show quick-starts with Eclipse, Lombok). I want to understand things and don't enjoy "magic" bootstraps that hide a lot of detail. I prefer less bloat from dependencies.
So, a lot of companies that are older, stable, and risk averse are using Java. This means Java isn't very exciting and it clearly doesn't have the 'pop' on a resume other 'cooler' languages do.
I don't think many people spinning up a new project will use Java. Go and C# are newer, often faster, and are just as full featured, not to mention Node/Python.
This doesn't mean Java is a dead end. I think a lot of Java concepts are pretty transferrable to other OOO languages, and because of the stability and longevity, it's a language you'll be able to find a lot of jobs with.
Perhaps Spring Framework/Boot is declining in popularity, but that's just wishful thinking--and my real beef is with Hibernate+JPQL.
Oddly Java itself as a language is better than ever and still improving.
When I saw that reason 1 was "Java Is Becoming Less Popular", I had to scroll back up and reread the question. OK - kinda circular.
Then I chuckled when I released it's the other side of "We use Java because everyone knows Java" that I've been hearing for years.
The reasons I avoid Java:
* too many large updates in the past for vulnerabilities.
* two large corporations extinguished Sun Java.
Unless the project is already partially built in Java
If I had to name one missing language feature that imperils Java it would be the lack of compiler-checked null-safety. After using both Swift and Kotlin this is a feature I dearly miss in Java.
The most glaring problems with the language are actually being addressed, and beside that, the tooling is amazing and the ecosystem is very mature and stable.
I only wish they would hurry up with the foreign memory API. Because only being able to memory map 2 Gb at a time is a pain in the ass than yesterday's vindaloo.
I am from the international church of record.
Do you have time to talk about our lord and savior `record classes`?
https://docs.oracle.com/en/java/javase/15/language/records.h...
I just learned C# 2 years back and it opened my eyes to basically Java with less boilerplate. Now with ASP.NET, it's the same thing. It's Spring Boot with less boilerplate and more streamlined.
I push new projects to use .NET as much as possible.
It’s not the go-to language for anything related to data science or ML, or webdev, or getting a job at FAANG. I’m not even sure it’s possible to write an Android app in pure Java anymore.
All this stuff about Oracle owning the IP or being mad about getters and setters is just internet people ranting to get their quick anger fix.
Okay, so Java has the var keyword, which does type inference and has been around since version 10 (4 years now). And it's not like people don't like statically typed languages... ever heard of a little thing called Rust?
Also, as has been mentioned, getters and setters were fixed through the introduction of Records in Java 14 (2 years ago).
The example code for exceptions is kind of weird, as the author mentions the throws list, but doesn't have any throws declarations in there; and in try catch you can just catch Exception ex to have a default handler. And it wouldn't make sense to complain about having to catch new exceptions if you want to handle those exceptions separately. In fact it doesn't make sense to blame Java for breaking API changes, those can happen in any language.
I don't use Java much these days, is this a huge issue still? Back when I used to do a bit of light java, mainly dealing with minecraft server plugins, almost everyone used lombok which seemed to do the job.
It's boilerplate for the sake of boilerplate.
I code primarily in Java, and I can't really say the last thing I wrote a getter or a setter, except possibly because I wanted a functional reference.
Accessor methods is part of a style of code Java that was unfashionably outdated 10 years ago.
If you have an object with properties A and B, but later realize that B can be calculated from A, it would be nice to eliminate the class of "Inconsistent A and B Values" bugs from your software, by making B calculated from the value of A. The problem is, without computed properties, that involves replacing the Object.B expressions with Object.getB() expressions, breaking your API.
So Java developers got in the habit of putting getters and setters on everything.
Besides the obvious violation of the YAGNI-principle and stinky mixture of data and logic, even if this scenario arises (which it very rarely does) any Java IDE worth its salt can replace a variable access with a method with a few mouse clicks.
Now, in 1995, maybe...
Why not add some first class immutable structure syntax to avoid need for getters/setters at all. Just so many better languages to choose from these days, Java is too far behind. And where they bridge the gap, they tend to do it in an awkward way.
Most of these bridge features are hobbled by BC concerns. E.g lambdas, generics
I referenced the Tiobe Index, and it has Java at #3. So, who knows?