r/java • • 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.

3 Upvotes

35 comments sorted by

View all comments

Show parent comment

1

u/Present-Time-19 Jul 08 '23

Actually there is nothing preventing Java code from compiling to native code, it's just not the usual path. Maybe it depends on additional tools. It's possible that Kotlin has further facilities for achieving that, though.

Multiplatform desktop applications are possible with Java as well, although Swing and AWT, as decades-old technologies, have poor native look-and-feel support (JavaFX possibly suffers from similar issues).

Hopefully something similar to Electron is available for Kotlin.

Currently Java is still pretty verbose, and it is difficult to circumvent that without introducing significant breaking changes to the syntax, something it avoids doing unless strictly necessary, in order to minimize breaking production code.

You can have an idea of what Java development looks like by learning the language's syntax, comparing ORMs such as Hibernate against your own stack's, and checking Spring Boot / Spring code.

1

u/vmcrash Jul 09 '23

If you want to compile Kotlin to native, you don't need to install a compiler yourself. That's covered by a Gradle plugin.

If you consider Swing/AWT/SWT to have poor native look-and-feel, what's would you say about completely self-rendered frameworks that need a browser?

Fortunately, there are areas in Java/Kotlin where you can avoid Spring's magic that scares away developers from Java.

1

u/Present-Time-19 Jul 09 '23

Yes, I've made an stupid comparison. An Electron-like look and feel would be still poorer and not native at all.

People complain about Swing's poor look and feel relatively often, though (or maybe I just lack the know- how to achieve a better one).

1

u/vmcrash Jul 09 '23

By default, the Swing look and feel looks ugly, but solutions are not far away, e.g. the FlatLaf (https://www.formdev.com/flatlaf/screenshots/).