DEV Community

Aristek Systems
Aristek Systems

Posted on • Edited on

Is Java Still Relevant?

Image description

It is. In this article, we’ll figure out why.

Few programming languages have been around for so long. Java started in 1995, and in 2023 it’s still among the top 3 languages. Research points to Java’s popularity as well: Stack Overflow, TIOBE index, and GitHub.

Image description

Java is a cross-platform programming language. It has a virtual machine called JVM that makes Java cross-platform. Java is mostly used in large enterprise applications and for Android development. But it’s a general-purpose language, so you can find it virtually everywhere.

What’s So Good About Java

It’s Platform-Independent

Java has a slogan: write once, run anywhere.

Not all programming languages are like that. Many languages require extra programming to run on multiple platforms.

For example, let’s take the language C. When you run a C program, the computer translates the source code into machine code. The source code is what the programmer writes. The machine code is what the computer can read: zeroes and ones.

Different processors and operating systems need specific machine code. So if your C program is written for a desktop, your phone can’t read it. To adapt C code to a new platform, developers need to recompile the code for that specific platform. This takes a lot of extra work.

In Java, it’s much easier thanks to Java Virtual Machine (JVM).

JVM stands in between the source code and the machine code. Developers don’t have to recompile your program for each new platform, it’s all automatic. You can run the same Java code on any device that supports JVM: a phone, a desktop, a smartwatch, or even a microwave.

If you are a Java developer, you may find that the article oversimplifies JVM quite a bit. That’s true. We intentionally omit bytecode, JRE, and other tech details to focus on the core principles of how Java works.

It’s Great For Enterprise Applications

Java is object-oriented. Object-oriented programming (OOP) makes development faster, and that’s why it’s the golden standard for enterprise software.

If you’re a non-tech person, here’s what you need to know about OOP:

Imagine that you’re building a Tetris game. You need to make the falling pieces: the shapes, colors, falling speed, etc.

You can do it in two ways:

  • Procedural programming.You can create each Tetris piece from scratch.Even if you want the pieces to fall with the same speed, you’ll need to input the speed for each single piece.This approach takes a long time. The bigger your project, the worse it’s going to be.
  • Object-oriented programming. Instead of doing everything from scratch, you can create a generic figure called a class.With OOP you can easily adjust properties for thousands of objects – because they share common properties. If you want to make all Tetris pieces slower, you can do it in a few clicks. No need to manually go back to every single shape.

OOP languages like Java save a ton of work for enterprise projects, because developers can write reusable code and modules. If you want to know more, read our read our in-depth article about OOP.

It’s Secure

Java applications have additional layers of protection.

The virtual machine runs the apps in a sandbox environment. It means that Java applications can only access your system when it has permissions. Without access rights, the application won’t get into your operating system, camera, or network.

To ensure that the applications you run are safe, Java has class loading and bytecode verification. These mechanisms check your code to see if it’s trusted and verified.

To reduce memory leaks, Java has automatic memory management. When you run a Java application, it automatically reclaims memory and protects you from vulnerabilities.

It’s Stable & Mature

A trendy programming language can go out of fashion in a few years. Objective-C was popular for a while in the 2010s. Today, it’s almost obsolete. If you had an Objective-C project, you’ve probably migrated to Swift by now.

Image description

Meanwhile, Java is not going anyway. If you build your project with Java, you can maintain it for years to come.

Java has a huge community. It means that there is plenty of talent to hire and lots of available jobs.

Also, popularity makes development faster. When Java developers run into a problem, they can find the answer to almost anything online. No need to reinvent the wheel.

What if your project needs a rare database or an unpopular service? There’s probably a Java driver for it. Chances are, you can also find best practices and frameworks developed with the drivers.

All this means that you can tackle virtually any task within the Java ecosystem.

What’s Wrong With Java

While Java is a great option for many projects, this language is not for everyone. Let’s check out the disadvantages.

Mediocre Performance

Remember that Java is platform-independent thanks to the JVM? This comes at a cost.

Let’s compare Java with C once again. There’s no virtual machine in C, so the source code gets compiled straight to the machine code. C is not platform-independent, but it’s fast.

Java’s JVM makes your device do more calculations. First, the processor runs JVM, then JVM runs the code. This way, Java apps are 1.5-2 times slower than applications written in C.

To tackle the performance issues, Java has 3 main projects:

  • Project Valhalla will make the memory use more efficient. It will eliminate unnecessary object creation and garbage collection. This way the applications will be more lightweight.
  • Project Loom will improve parallel computing. It will increase computation speed and make debugging easier.
  • Project Panama will improve support for other programming languages. It will be easier to integrate Java code with other systems. With libraries from other languages, developers will have more options to create fast applications.

Verbose Сode

Java creators wanted to make coding very explicit and clear. So they did. Java is very precise, but you can also say that the syntax is verbose.

To illustrate, let’s write a ‘Hello, World’ program in Java and Ruby.

Here’s Java:

`class HelloWorld { 
   public static void main(String[] args) { 
       System.out.println("Hello, World!");  
   } 
} `
Enter fullscreen mode Exit fullscreen mode

Here’s Ruby:

puts "Hello, World!"
Enter fullscreen mode Exit fullscreen mode

Because Java is so explicit, it doesn’t leave space for second-guessing. If anything, developers can write a lot of unnecessary details.

It is a double-edged sword. Until something goes wrong, coding with Ruby is faster. But when it does go wrong, it’s much easier to debug with Java.

That’s why Java works best for enterprise-level applications, while Ruby is better for simple and small projects.

Slow Feature Release

New Java versions are released twice a year. The problem is that the new versions lack stability and security patches. As a result, many Java developers stick with the Long-Term Support (LTS) versions that only come out every 3 years.

For example, the current version is Java 20. Meanwhile, at Aristek Systems we still use Java 17 LTS. This way we ensure that our projects are reliable and bug-free. The LTS version receives security patches and bug fixes for 5-8 years. A regular Java release only gets 6 months.

Java lets you choose. You can either get new shiny features every 6 months or wait a few years for a stable LTS version. Thankfully, the upcoming Java 21 will have long-term support. You don’t have to wait long.

Image description

How To Choose A Programming Language
With Java, you can build almost anything. Java is especially good for enterprise software.

Web and desktop applications. In Big Tech, Java is the most popular back-end language. Take a look at the languages big tech uses for web applications:

Image description

Android applications. Most Android apps are written in either Java or Kotlin. Kotlin is based on the Java Virtual Machine. Companies like Twitter, Spotify, Signal, and CashApp all have Android apps built with Java.

Internet of Things (IoT). JVM makes software truly platform-independent. It’s not just for desktop, web, or mobile. You can find Java on all kinds of devices:

  • Education. AR and VR apps, interactive whiteboards, and lab equipment.
  • Healthcare. Medical imaging devices, wearable health trackers, glucose meters, or insulin pumps.
  • Finance. ATMs, point-of-sale terminals, and crypto-wallets.
  • Logistics. GPS navigators and vehicle computers that track mileage, fuel consumption, or speed.

But sometimes it’s best to choose other technologies:

  • Small Websites. For simple solutions, Java can be an overkill. With a framework like PHP Symfony, you’ll get your project faster.
  • iOS Applications. There is no JVM for iOS. You can find workarounds like compiling your app to Objective-C. But frankly, if you need an iOS application, it’s easier to start with Swift. Alternatively, you can create a cross-platform iOS/Android app with React Native.
  • Operating Systems. Low-level software like operating systems or drivers needs a language without a virtual machine. If you’re building a new Windows, stay away from Java.

Java has been around for 25 years and it seems like it’ll be around for the next 25 years. New feature releases fix the existing problems, and some experts see a Java renaissance. So starting with Java may be a good option for long-term projects.

If you need help choosing a programming language, get in touch. For 10 years we’ve been building software with many technologies: Java, Node JS, React JS, PHP, and others. We’ll help you find the right tech stack.

Top comments (1)

Collapse
 
khmarbaise profile image
Karl Heinz Marbaise

Java’s JVM makes your device do more calculations. First, the processor runs JVM, then JVM runs the code. This way, Java apps are 1.5-2 times slower than applications written in C.

This sounds like ignoring the JIT compilation..and as always it depends on the application.. I would like to see someone writing a microservice using C? How long will take? And more important how maintainable is that code? (That would be a horror in C)..ah and if the JVM might be really a problem (in 99.99999%) of the cases I doubt you can compile it via GraalVM...

Java is object-oriented. Object-oriented programming (OOP)

That's partially wrong, because Java supports also functional propramming (since JDK8 2014!)..(it was possible before, but not practical)

Verbose Сode

Always the same stupid example... just the main method...
Here is an example for upcomming JDK versions (openjdk.org/jeps/445 preview in JDK21 and finalized in JDK22):

void main() {
    System.out.println("Hello, World!");
}
Enter fullscreen mode Exit fullscreen mode

Apart from that is this everything? Really that would be a criteria to choose a language? I have doubts about that.

You are missing big differences between scripting languages like Ruby, Python etc. compared to compiled languages (Type safety!), parallelization etc. also installation on systems (operations) and support for containers and not to forget the whole ecosystem (libs, frameworks etc.) and if you don't like Java use Scala, Kotlin ... running on the JVM ...If you want simpler languages you should check for Go (is easy to learn but you have to compile for each os/platform) and more sophisticated Rust(need to be compiled as Go).

New Java versions are released twice a year. The problem is that the new versions lack stability and security patches. As a result, many Java developers stick with the Long-Term Support (LTS) versions that only come out every 3 years.

Simply wrong. Every six months a new version is released .. and no those releases are stable as any other version. And get, yes patches for 6 month up to the next version also so called LTS(not really check this: youtube.com/watch?v=3bfR22iv8Pc) coming every two years...

Ah btw. if you like to have support you have to pay for it... oracle.com/java/technologies/java-...

This way we ensure that our projects are reliable and bug-free.

That can be be achieved by using automated tests..

Java lets you choose. You can either get new shiny features every 6 months or wait a few years for a stable LTS version. Thankfully, the upcoming Java 21 will have long-term support. You don’t have to wait long.

Every version is stable.