Slide 1

Slide 1 text

Modern Java for the Masses! Is Java Still Relevant? Deepu K Sasidharan

Slide 2

Slide 2 text

@oktaDev | @deepu105 | deepu.tech ➔ JHipster co-lead developer ➔ Java Champion ➔ Creator of KDash, JDL Studio ➔ Developer Advocate @ Okta ➔ OSS aficionado, polyglot dev, author, speaker Hi, I’m Deepu K Sasidharan @[email protected] deepu.tech @deepu105 deepu05

Slide 3

Slide 3 text

@oktaDev | @deepu105 | deepu.tech I’m a Polyglot Developer

Slide 4

Slide 4 text

@oktaDev | @deepu105 | deepu.tech My Journey With Programming Languages PHP JavaScript C++ Java Dr Scheme Java JavaScript Go TypeScript Python, Ruby Rust C# 2003 2006-2008 2010 2010-2016 2016-2020 2021

Slide 5

Slide 5 text

@oktaDev | @deepu105 | deepu.tech My Favorite Programming Languages

Slide 6

Slide 6 text

@oktaDev | @deepu105 | deepu.tech I ❤ Rust

Slide 7

Slide 7 text

@oktaDev | @deepu105 | deepu.tech Is Java Still Relevant?

Slide 8

Slide 8 text

@oktaDev | @deepu105 | deepu.tech Boring? Old? Stagnant?

Slide 9

Slide 9 text

@oktaDev | @deepu105 | deepu.tech Age of Popular Mainstream Languages Go C# Rust 1991 1985 2011 2009 2000 2015 Ruby Kotlin 1995 Python PHP JavaScript C++ Java 1972 2023

Slide 10

Slide 10 text

@oktaDev | @deepu105 | deepu.tech TIOBE Popularity Index

Slide 11

Slide 11 text

@oktaDev | @deepu105 | deepu.tech Intellimenta Popularity Index (Stack Overflow Data)

Slide 12

Slide 12 text

@oktaDev | @deepu105 | deepu.tech Evolution of Java

Slide 13

Slide 13 text

@oktaDev | @deepu105 | deepu.tech Java Evolution (The Boring Phase) JDK GC Green Threads JVM 1.0 1996 Platform Threads Inner Classes JDBC JIT Reflection 1.1 1997 Swing Collections HotSpot JVM JNDI RegEx JAXP Logging API NIO 1.2 - 1.3 - 1.4 1998 - 2000 - 2002 Generics Annotations Enums Static Imports Concurrency utils 1.5 (5) 2004 Modules HTTP2 Client JShell Private Interface -methods 9 2017 ForkJoinPool JAX-WS Compiler API GC algos Diamond Operator NIO 2 6 - 7 2006 - 2011 Streams CompletableFuture Lambda Optionals Functional Interface Nashorn 8 (LTS) 2014

Slide 14

Slide 14 text

@oktaDev | @deepu105 | deepu.tech Java Evolution (The Exciting Phase) JDK var type inference Parallel to G1 JIT Compiler (E) 10 2017 HTTP Client API Single file launch 11 (LTS) 2018 Switch Expressions (P) Text Blocks (P) 12 - 13 2019 Instanceof pattern -matching (P) Records (P) Switch Expressions Packaging Tool (I) Foreign-Memory -Access API (I) Sealed Classes (P) Hidden Classes Text Blocks 14-15 2020 Scoped Values (I) String Templates (P) Sequenced Collections Generational ZGC Record Patterns Pattern Matching for -switch Unnamed Patterns and -Variables (P) Virtual Threads Unnamed Classes and -Instance Main -Methods (P) Scoped Values (P) 20-21 (LTS) 2023 Vector API (I) Foreign Linker API (I) Packaging Tool Instanceof pattern -matching Records Pattern Matching for -switch (P) Sealed Classes Foreign Function & -Memory API (I) 16 - 17 (LTS) 2021 Simple Web Server Record Patterns (P) Virtual Threads (P) Structured -Concurrency (I) 18-19 2022 E - Experimental P - Preview I - Incubator

Slide 15

Slide 15 text

@oktaDev | @deepu105 | deepu.tech Modern Java

Slide 16

Slide 16 text

@oktaDev | @deepu105 | deepu.tech ● Locar var Type Inference ● Text Blocks ● Switch Expressions ● Pattern Matching for Instanceof ● Pattern Matching for Switch ● Records ● Foreign Function & Memory API ● Sealed Classes ● Hidden Classes ● Vector API ● Simple Web Server ● Record Patterns ● Virtual Threads ● Structured Concurrency ● Scoped Values ● String Templates ● Sequenced Collections ● Unnamed Patterns and Variables ● Unnamed Classes and Instance Main Methods Java 10 - 21

Slide 17

Slide 17 text

@oktaDev | @deepu105 | deepu.tech Modern Java Language features ☑ Strongly typed ☑ Generics ☑ Pattern matching ☑ Coroutines (Virtual Threads) ☑ Foreign Functions ☑ Rich standard Library ☑ Object Oriented programming ☑ Functional programming ☑ Higher-order-functions & Closures (Lambda) ☑ Type inference (Local var) ☑ Object deconstruction (Records and Array only) ☑ Immutable ☑ Null safe Tooling & Ecosystem ☑ JIT ☑ AOT (via GraalVM) ☑ Build system (Maven or Gradle) ☑ Package Manager (Maven or Gradle) ☑ Package repository (Maven Central) ☑ Formatting/Linting (Plugins) ☑ Shell (JShell)

Slide 18

Slide 18 text

@oktaDev | @deepu105 | deepu.tech Java 21 void main() { var name = "Deepu"; System.out.println(STR. "Hello, \{ name }!" ); var point = new Point(10, 10); switch (point) { case Point(var x, var _) when x > 5 -> System.out.println("It’s a big X point"); case Point(var _, var y) when y > 5 -> System.out.println("It’s a big Y point"); default -> System.out.println("It’s just a point"); } Thread.startVirtualThread(() -> { System.out.println("Hello, Project Loom!"); }); } record Point(int x, int y) {}

Slide 19

Slide 19 text

@oktaDev | @deepu105 | deepu.tech So Why Java?

Slide 20

Slide 20 text

@oktaDev | @deepu105 | deepu.tech Strengths of Java

Slide 21

Slide 21 text

@oktaDev | @deepu105 | deepu.tech Mature Ecosystem

Slide 22

Slide 22 text

@oktaDev | @deepu105 | deepu.tech Stability

Slide 23

Slide 23 text

@oktaDev | @deepu105 | deepu.tech Community

Slide 24

Slide 24 text

© Okta and/or its affiliates. All rights reserved. Confidential Information of Okta – For Recipient’s Internal Use Only. @oktaDev | @deepu105 | deepu.tech Java == Building a Critical Service or SaaS Company

Slide 25

Slide 25 text

© Okta and/or its affiliates. All rights reserved. Confidential Information of Okta – For Recipient’s Internal Use Only. @oktaDev | @deepu105 | deepu.tech Rust == Coding for Fun or Building OSS Side Projects

Slide 26

Slide 26 text

@oktaDev | @deepu105 | deepu.tech Weakness of Java

Slide 27

Slide 27 text

@oktaDev | @deepu105 | deepu.tech Baggage

Slide 28

Slide 28 text

@oktaDev | @deepu105 | deepu.tech

Slide 29

Slide 29 text

@oktaDev | @deepu105 | deepu.tech Resource Hungry

Slide 30

Slide 30 text

@oktaDev | @deepu105 | deepu.tech When To Use Java

Slide 31

Slide 31 text

@oktaDev | @deepu105 | deepu.tech Right Tool for the Job!

Slide 32

Slide 32 text

© Okta and/or its affiliates. All rights reserved. Confidential Information of Okta – For Recipient’s Internal Use Only. @oktaDev | @deepu105 | deepu.tech Right Language Use Case Team Experience Target Platform Memory Safety

Slide 33

Slide 33 text

@oktaDev | @deepu105 | deepu.tech Web Applications/Microservices ● Great ecosystem and frameworks ○ Spring, JHipster, Micronaut, Quarkus, Jakarta EE, etc ● Reliable and high performing ○ With an optimized impl, can often outperform Rust/C++ ● Fast ramp up and go to market ● High concurrency Enterprise Applications ● Secure ● Reliable and high performing ● Backward compatibility ● Mature ecosystem When to Use Java Big Data Applications ● Great ecosystem ○ Apache Hadoop, Apache Spark ● Scalable for large volume of data ● High concurrency ● Reliable Android Applications ● One of the primary language ● Great ecosystem

Slide 34

Slide 34 text

@oktaDev | @deepu105 | deepu.tech When not to use Java

Slide 35

Slide 35 text

@oktaDev | @deepu105 | deepu.tech CLI Applications ● Not a lot of good libraries ● Limited support for interactions ● No Curses/Terminal UI ● Use Rust, Go, Python or NodeJS Real-Time Systems ● Aerospace, Robotics, High frequency trading ● GC pauses cannot guarantee real-time responses ● Use Ada, Rust, C/C++ When Not to Use Java Systems programming ● Drivers, OS, CLIs ● Not suitable for low-level programming ● GC overhead ● Weak Foreign Function Interface ● Use Rust, C/C++ High Performance Systems ● GC overhead ● High memory usage ● No Zero Cost Abstractions ● Use Rust, C/C++

Slide 36

Slide 36 text

@oktaDev | @deepu105 | deepu.tech Java for beginners

Slide 37

Slide 37 text

© Okta and/or its affiliates. All rights reserved. Confidential Information of Okta – For Recipient’s Internal Use Only. @oktaDev | @deepu105 | deepu.tech Beginner Java as First-Language Knows another Language ● Learn with the latest version ● Learn types, operators, functions, control flow, generics, pattern matching ● Learn Java specifics (Classes, inheritance, polymorphism, abstraction, lambda, virtual threads) ● Learn basics of OOP and Functional programming ● Learn data structures ● Learn the Java standard library ● Do not learn with frameworks, learn with pure Java ● Learn with the latest version ● Learn Java specifics (Classes, inheritance, polymorphism, abstraction, lambda, virtual threads) ● Learn basics of OOP and Functional programming if needed ● Learn the Java standard library ● Learn Maven or Gradle ● Learn Spring Framework

Slide 38

Slide 38 text

@oktaDev | @deepu105 | deepu.tech Thank You Subscribe to our newsletter a0.to/nl-signup/java Try our free Spring Boot + Passkeys workshop a0.to/spring-boot