Why Java ?
Omar Bashir
https://www.linkedin.com/in/obprofile/ @OmarBashir_40
Background
Language From Used Last Used For
C 1995 2006 Dedicated/
Embedded Apps
Java 1996 Current Enterprise Apps
C++ 1998 2012 Dedicated/
Enterprise Apps
C# 2008 2015 Enterprise Apps
Scala 2012 2017 Enterprise Apps
Initial Adoption
● Mandated by BT for their University Research
Initiative (URI) in 1996 as a PoC.
● C-style but safer than both C and C++.
● Simpler than C++.
● WORA (Write Once Run Anywhere).
Continued Appeal
● Simple and intuitive concepts.
● Extensive tool support.
● A large and growing ecosystem.
● A wide talent pool globally.
Criticisms
● Verbosity
– Too much text leading to developer fatigue.
● Footprint
– Heavyweight class library.
● Elegance
– Largely imperative code.
● Syntactic sugar
– Generic erasures.
Criticisms
● Uniformity
– Primitives vs. wrapper classes.
– Autoboxing.
● Exceptions
– Checked and unchecked.
● Frameworkitis
– The disease that a framework wants to do too much
for you or it does it in a way that you don't want but
you can't change it.
Optimism - Elegance
● Functional programming since Java 8.
– Lambda expressions.
– Stream API.
● Collections factory methods since Java 9.
– Set<Integer> ints = Set.of(1, 2, 3);
● Additional Stream API methods in Java 9.
– dropWhile, takeWhile, iterate, ofNullable.
● Enhancements in String API all along.
Optimism - Verbosity
● Local variable type inferencing from Java 10.
– Optimises over diamond operator.
● var list = new ArrayList<String>();
● Switch statement improvements from Java 12.
– Converted to expressions returning values.
– Breaks removed.
– Multiple options serialised on a single line.
● Text blocks from Java 13.
– Complex multi-line text can be specified between
triple quotes (“””).
public void executeNewSwitchExpression(String day){
    String result = switch (day) {
        case "M", "W", "F" ­> "MWF";
        case "T", "TH", "S" ­> "TTS";
        default ­> {
            if(day.isEmpty())
                break "Please insert a valid day.";
            else
                break "Looks like a Sunday.";
        }
    };
    System.out.println(result);
}
Switch Expression
Optimism - Modularity
● Project Jigsaw – Java 9
– Create a module system for the language.
– Apply it to the JDK source.
– Modularize the JDK libraries.
– Update the runtime to support modularity.
– Create smaller runtime with a subset of JDK modules.
● Stronger encapsulation at jar level.
– Better control of service granularity.
Selecting Java for a Project
● Technology unification programme initiated in
2015.
– Kotlin v1.0 released in early 2016 limiting choice
between Java and Scala.
● Talent – key reason for choosing Java.
– 90 developers in 4 global location.
● Microservices architecture.
– Choosing an appropriate language for the service.
– Emerging Java features made it a strong contender.
Reflections
A Tale of Reversion – Early 2016
● A Scala based microservices application.
● Challenges,
– Long cycle time to implement idiomatic Scala code.
– Steeper learning curve.
– Small, fluid talent pool.
● Piloted Java 8 with existing team,
– Positive overall developer experience.
THE END

Why Java ?