Java: A Gentler Hello
Java, the programming language, is 28 years old and showing its age. However, it continues to evolve and continues to be relevant. One of the effort is to be more friendly to newbies.
A first introduction to any programming language is the now legendary 'Hello World!' program, a tradition established by Kernighan and Ritchie in their seminal book, 'The C Programming Language.'
The 'freindliness of a programming language is measured by how soon a beginner can run the 'Hello World!' program. Languages like Python and JavaScript beat the Java language in this aspect.
Java is considered too Verbose and High Ceremony. Brian Goetz, a Java Architect, with Oracle Corporation proposed an enhancement to address these issues.
We can now write the Hello World program simply as below.
void main() {
System.out.println("Hello, World!");
}
This can be executed as
> javac --release 21 --enable-preview Main.java
> java --enable-preview Main
The above is just one feature. There is much more in the JEP 330.
Evolving a language is often contentious. The newer changes may conflict with the existing language features or worse; it may clash with it's core philosophy. The language can become bloated. But the language architects have to weigh these options and evolve the language weighting the various aspects.
Note: I am available for consultation on Software Architeture, Code Review and Software Strategy.