Java...what am I supposed to do with you? 😅

(2024/01/02) - 10 minute read

 

Java is one of the most famous and widely used programming languages in the world.

It is designed to create platform-independent, object-oriented and secure applications that can run on various devices.

But how did Java become so popular?
And what is the future of Java today?

In this article, we will answer these questions and provide an overview of Java's development, distribution, and alternatives.

 

What is Java and what was its purpose

 

Java was originally developed by James Gosling at Sun Microsystems in the early 1990s as part of a project called
Green.
The goal was to create a programming language that would be suitable for interactive televisions.
However, because the television industry was not interested in the new technology, Java was adapted for the
Internet instead.

Java was intended to be a simple, robust, portable and dynamic language that leverages the virtual machine concept to run on various operating systems and hardware platforms.
It should also provide high security by preventing the execution of malicious code.

Java was officially released in 1995 and quickly gained popularity, primarily with the introduction of applets, which were small programs that could be embedded into web pages.

 

When and by whom was Java invented

 

As mentioned earlier, Java was invented by James Gosling, a Canadian computer scientist.
In this article, we will answer these questions and provide an overview of Java's development, distribution, and alternatives.
Java was originally developed by James Gosling at Sun Microsystems in the early 1990s as part of a project called
Green.
He was the lead developer and designer of Java, but he did not work alone and was supported by other engineers at Sun Microsystems, such as Patrick Naughton, Mike Sheridan, Ed Frank, Bill Joy and others.

The first version of Java was named Oak, after a tree that stood in front of Gosling's office.
Later the name was changed to Java, after an Indonesian island known for its coffee.

The name should also reflect the dynamism and liveliness of the language.

 

Spread of Java

 

Java quickly became one of the most popular and widely used programming languages in the world.

According to the TIOBE index, which measures the popularity of programming languages, Java was the number one or two most used language from 2001 to 2020.

Java has been used for a variety of applications such as desktop applications, web applications, mobile applications, games, databases, embedded systems and more.

Used by many large companies and organizations such as Google, Amazon, Facebook, Netflix, IBM, Oracle, NASA and others.
As well as used for developing open source projects such as Apache, Eclipse, Spring, Hibernate and others.

Java has also been used to train programmers because it is considered a simple and understandable language that teaches the basic concepts of object-oriented programming.

 

In direct comparison (popular back then, less so today?)

 

Although Java is still one of the most widely used programming languages, it has lost popularity in
recent years.

  • According to the Stack Overflow Developer Survey, an annual survey of programmers, Java fell to the fifth most popular programming language in 2020, behind JavaScript, HTML/CSS, SQL and Python. 

  • According to the GitHub Octoverse, a report on activity on the GitHub platform, Java fell to the sixth most used programming language in 2020, behind JavaScript, Python, Java, TypeScript, C# and PHP. 

These trends suggest that Java is becoming less relevant and attractive, especially when compared to newer and more modern languages that offer more features and flexibility.

 

Alternatives to Java

 

There are many alternatives to Java that may be more suitable depending on the purpose and the type of application one wants to develop.

Some of the most popular and widely used alternatives are:

  • Python: An interpreted, dynamically typed, and multi-paradigm language known for its simplicity, readability, and versatility. Python is used for a range of applications such as data analysis, machine learning, web development, scripting, and more.
    Python has a large and active community that provides many libraries and frameworks that make development easier.

  • JavaScript: An interpreted, dynamically typed, and multi-paradigm language used for developing websites and web applications.
    JavaScript is executed in the browser to create interactive and dynamic content, as well as on the server side with Node.js to create scalable and event-driven applications.
    JavaScript has a large and active community that provides many libraries and frameworks that make development easier.

  • C#: A compiled, statically typed, and multi-paradigm language developed by Microsoft to provide a modern and powerful alternative to Java.
    C# is used for developing desktop applications, web applications, mobile applications, games, and more, leveraging the .NET Framework, a platform that provides a set of libraries and services that make development easier.

  • Kotlin: A compiled, statically typed, and multi-paradigm language designed as an improved version of Java.
    Kotlin is fully interoperable with Java, meaning you can use existing Java code or write in Kotlin and compile in Java. This gives developers more freedom and opportunities to solve their problems.
    Kotlin offers many features that Java does not have, such as null safety, data classes, extension functions, lambdas, coroutines, and more.
    Kotlin is primarily used for Android application development as it is supported by Google as the official language for this platform.

 

New languages are taking over Java

 

As mentioned earlier, Python and JavaScript are two of the most popular and widely used programming languages in the world, having overtaken Java in many areas.

Some of the reasons why these languages overtake Java are:

  • Simplicity: Python and JavaScript are easier to learn and write than Java because they require less syntax and boilerplate code.
    Python and JavaScript are also dynamically typed, meaning there is no need to declare variable types, making development faster and easier.

  • Flexibility: Python and JavaScript are multi-paradigm, meaning they support different programming styles such as procedural, functional, object-oriented, and more.
    This gives developers more freedom and opportunities to solve their problems.
    Python and JavaScript are also interpreted, meaning they can be run directly without being compiled, making development and debugging easier.

  • Versatility: Python and JavaScript are used for a variety of applications beyond what Java offers.
    Python is used for data analysis, machine learning, web development, scripting, and more.
    JavaScript is used for web development, server development, desktop development, mobile development, and more.
    Both also have a large and active community that provides many libraries and frameworks that facilitate and extend development.

 

The top dog Java in the backend is increasingly being replaced by alternatives
(Rust, Go, Node,...)

 

Java has long been the dominant language for developing backend applications, applications that run on the server side and provide an application's logic, data, and services.

It was chosen for the backend because it offered high performance, scalability, reliability and security.
The programming language was also used by many large companies and organizations.
This is how Java-based frameworks and platforms such as Spring, Hibernate, Tomcat and others emerged.

However, in recent years Java has faced competition from other languages that are more attractive for the backend.

Some of these languages are:

  • Rust: A compiled, statically typed, and multi-paradigmatic language developed by Mozilla to provide a safe, fast, and practical alternative to C and C++.
    Rust is used for developing systems, applications and web services that require high performance, reliability and concurrency.
    Rust avoids many common sources of error, such as memory leaks, data races, and null pointers, by using a sophisticated type system and an ownership model that is checked at compile time.
    Rust has a growing and enthusiastic community that provides many libraries and tools that make development easier.

  • Go: A compiled, statically typed, and multi-paradigm language developed by Google to provide a simple, efficient, and scalable alternative to Java.
    Go is used for developing web services, cloud applications, networking programs, and more that require high performance, competitiveness, and productivity.
    Go offers many features that Java does not have, such as built-in contention, interfaces, structures, higher-order functions, garbage collection, and more.
    Go has a large and active community that provides many libraries and frameworks that make development easier.

  • Node.js: A runtime environment that runs JavaScript on the server side to build fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O architecture that enables high throughput and low latency.
    Node.js is used for developing web applications, real-time applications, microservices, and more that require high performance, flexibility, and interoperability.
    Node.js has a huge and active community that provides many libraries and frameworks that make development easier.

These languages have some advantages over Java......

  • Speed:  Rust and Go are faster than Java because they have lower memory and CPU usage, offer better optimization, and have lower overhead.
    Rust and Go are also better at handling contention and concurrency, which is crucial for the backend.

  • Simplicity: Rust, Go, and Node.js are easier to learn and write than Java because they require less syntax and boilerplate code.
    All three are also more modern and elegant than Java, as they offer many features that Java does not have, such as null safety (not Node.js), data classes, extension functions, lambdas, coroutines, and more.

  • Innovation: Rust, Go and Node.js are more innovative and future-oriented than Java as they take into account the latest trends and requirements of backend development.
    They are more adaptable and flexible than Java as they support different programming styles such as procedural, functional, object-oriented and more.

 

New Java features - will they be enough to catch up?

 

Java is aware of its challenges and seeks to improve and innovate to remain relevant and attractive.

In recent years, several new versions have been released, containing many new features and improvements that facilitate and expand development.

Java 21 is the latest version released in September 2023 and is a long-term support release (LTS), meaning it will be maintained and updated for at least three years.

Before that, it was Java 17, which was released in September 2021. 

 

Java 21 offers a number of new features and improvements that optimize the programming language and platform. 
Some of the key new features are:

  • Virtual Threads:  A new feature that makes it possible to create thousands or millions of lightweight threads that improve the scalability and performance of server-side applications.
    Virtual threads are managed by a virtual machine and can run on a limited number of native threads without exhausting or blocking resources.

  • Record Patterns: A new feature that makes it possible to use records, i.e. simple and immutable data classes, in pattern matching.
    These simplify and shorten the code by reducing the need for instanceof and casting operations.
    Record patterns are useful for implementing algebraic data types and other constructs.

  • Pattern Matching for switch: A new language feature that allows using a switch expression to check a value by its type and properties.
    This simplifies and shortens the code by reducing the need for instanceof and casting operations.
    Pattern Matching for switch is useful for implementing pattern matching, algebraic data types, and other constructs.

  • Sealed Classes (17+): A new language feature that allows restricting the subclasses of a class or interface.
    This increases the security, readability and modeling of hierarchical structures.
    Sealed classes are useful for implementing pattern matching, algebraic data types, and other constructs.

  • Text Blocks (17+): A new language feature that allows writing multi-line texts in a simple and readable way.
    Text Blocks avoid the need for escape characters, concatenations and formatting.
    These are useful for creating SQL statements, HTML pages, JSON documents, and other text.

  • Records (17+): A new language feature that allows defining simple and immutable data classes consisting only of condition fields.
    Records automatically generate constructors, getters, setters, equals, hashCode, toString and other methods.
    These are useful for modeling simple data structures such as points, pairs, tuples, and others.

  • Foreign Function and Memory API (17+): A new API that allows calling native code and memory from within Java.
    This API offers better performance, security and portability than the previous Java Native Interface (JNI) API. 
    It is useful for interacting with native libraries, operating systems and hardware.

These new features and improvements are a step in the right direction for Java, but they may not be enough to keep up with the other languages.

Java still has some disadvantages, such as:

  • Complexity: Java is still a complex and large language that requires many concepts, keywords, rules and exceptions.
    Java is also difficult to upgrade and migrate because it has many dependencies, incompatibilities, and deprecated features. 

  • Rigidity: Java is still a rigid and conservative language that has many limitations and conventions.
    It is also difficult to extend and modify as it has many fixed and closed structures which makes it difficult to integrate and connect with other languages as it requires many interfaces, adapters and bridges.

  • Boredom: Java is still a boring and outdated language that requires a lot of repetition, redundancy and boilerplate code.
    Java is also difficult to read and write as it has many brackets, semicolons and spaces, making it difficult to enjoy and motivate as it has many restrictions, regulations and formalities.

 

Should I learn Java today?

 

The answer to this question depends on many factors such as the learner's goal, interest, background and context.

There are some reasons why you should learn Java today, such as:

  • Distribution: Java is still one of the most used and sought-after programming languages in the world, offering many possibilities and resources.
    Java is used by many large companies and organizations looking for qualified and experienced Java developers.
    Java is also used for many open source projects looking for contributions and collaborators.
    Java is also used for training programmers looking for knowledge and skills.

  • Reliability: Java is a robust and secure language that provides many mechanisms to prevent and handle errors.
    Java uses the virtual machine, which forms an abstraction layer between the code and the hardware to ensure portability and compatibility.
    Java also uses garbage collection, which automatically manages and frees memory to avoid the memory leaks and fragmentation.
    Java also uses exception handling, which allows unexpected situations to be detected and handled without interrupting the flow of the program.

  • Fundamental: Java is a fundamental and influential language that teaches many concepts and principles useful for understanding and learning other languages.
    Java is an object-oriented language that enables modeling of real-world entities and relationships using classes, objects, inheritance, polymorphism, and other constructs.
    Java is also an imperative language that allows statements to be executed in a specific order using variables, operators, control structures, and uses other constructs.
    Java is also a generic language that enables code reuse and type safety by leveraging generics, collections, streams, and other constructs.

But there are also some reasons why you should no longer learn Java today, such as:

  • Deprecated: Java is an outdated and outdated language that has missed or delayed many features and improvements offered by other languages.
    Java is a slow and inefficient language that has high memory and CPU usage, poor optimization, and high overhead.
    Java is an inflexible and conservative language that has many limitations and conventions that hinder and complicate development.
    Java is a boring and monotonous language that requires a lot of repetition, redundancy, and boilerplate code that slows down and complicates development.

  • Irrelevant: Java is an irrelevant and unattractive language that ignores or fails to meet many trends and requirements of modern development.
    Java is an isolated and incompatible language that offers poor interoperability and integration with other languages, platforms and technologies.
    Java is a static and closed language that offers poor adaptability and extensibility to different programming styles, paradigms and constructs.
    Java is an inadequate and incomplete language that provides poor support and implementation for important features such as functional programming, pattern matching, algebraic data types, and others.

 

Is Java soon to be a dying language but a well-paying job?

 

The answer to this question is not easy because there are many factors that can affect the future of Java.

It is possible that Java, like Cobol, will soon become a dying language, used and maintained by only a few people who, in contrast, are well paid for it (supply and demand). 

This could happen,
....if Java continues to lose its popularity and relevance,
....if Java does not continue its innovation and renewal,
....if Java does not maintain its stability and reliability,
....if Java fails to maintain its distribution and resources, or if Java does not maintain its foundation and influence.

However, it is also possible that Java will not become a dying language, but will remain a vibrant and successful language that is used and improved by many people. 

This could happen, 
 ....if Java regains its popularity and relevance,
....if Java continues its innovation and renewal,
....if Java maintains its stability and reliability,
....if Java increases its distribution and resources increased,
....if Java maintains its foundation and influence

 

Conclusion

 

Java is one of the most famous and widely used programming languages in the world, which has many advantages and disadvantages.
It was designed to create platform-independent, object-oriented and secure applications that can run on various devices and quickly became a popular and most requested language used for a wide range of applications.

In today's world, it has also become an outdated and outdated language that has been overtaken by many alternatives.
Java is trying to improve and innovate to stay relevant and attractive, but it is uncertain whether that is enough to keep up with the other languages.

Soon, Java could become a dying language, or it could remain a vibrant and successful language.

Deciding whether to learn Java today depends on many factors, such as the learner's goal, interest, background, and context.

"Java is a language you can love or hate, but you can't ignore it".
A language that makes you ask yourself: Java, what should I do with you?
 

Ultimately, like any article that aims to answer the questions of whether it's worth using Java or whether the language is good or bad...... "it depends!"
Everyone has to decide for themselves and do what is best in their own situation, with all the information and advice given here.

To break this vicious circle... Yes, it's worth learning and use  Java 😅

 

I hope you enjoyed reading the article as much as me writing it

Renier Roth