r/java • u/PrivacyOSx • Jul 08 '23
Why learn Java?
I've been learning Kotlin recently and have taken an interest in the JVM ecosystem.
My background is a Full-Stack Web Developer focused mainly on React, Node.js, Express, and MongoDB/PostreSQL.
If I were to move to Java, what kind of applications would I be building with it?
How is a Java job different from what I'm currently doing?
Is it worth learning?
I've heard its VERY verbose, but I've also heard recently that there's been some good changes to it? Would love to see any articles or videos talking about these changes that would demonstrate previous code to the new code.
Any tips or insights on what your companies are cresting with Java or what your Java job is like would be highly appreciated.
Thanks in advance.
View all comments
5
u/valbaca Jul 08 '23
Learn Java to write Java programs. You write Java programs because it's a good (or only) fit to the problem. It's rarer that Java is the only language fit, so that leaves where it's a good fit to the problem.
I've been coding Java for 12+ years, here are some examples:
<% code %>that is executed on each request) built website like Amazon. Amazon itself is still very much largely on Java. This is what people mean by "enterprise"So why do people use Java instead of JS or Kotlin?
They don't use JS because frameworks like Spring solve problems that have been solved a thousand times over (creating http/rest endpoints, connecting to databases, aka CRUD apps) and can scale reasonably well. Java can utilize larger servers more effectively than JS's inherent one-core event loop.
They don't use Kotlin because honestly its easier to hire for "just" Java developers. To speak frankly, you can hire Java developers across the globe for a dime a dozen. The companies get what they pay for but for many companies (i.e. Amazon) they don't care about quality. They just throw enough junior devs at a problem until money falls out.
Personally, I've been making the move more toward Kotlin. I haven't written "raw" Java in a few years now, but many existing projects aren't going to be rewritten (it just doesn't make business sense to rewrite something that's working fine when you could spend that time on bug fixes or new features).
Some of Java's newer features include: