SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
THE FUTURE OF JVM LANGUAGES
AND THE EVOLUTION OF PROGRAMMING LANGUAGES
Victor Szoltysek
4 MODERN JVM LANGUAGES
Programming
Language
1969
- Margaret Hamilton


(with stacks of assembly
code she wrote for the first
moon landing mission)
?
43 00 00 00 inc ebx
MACHINE CODE ASSEMBLY
No matter the programming language chosen, a
professional developer will write an average of
10 lines of code (LoC) day.
Frederick Brooks
1980
1980 - MOBILE
?
mov eax, $
x

cmp eax, 0x0C
jg en
d

beginning:
inc eax
cmp eax, 0x0C
jle beginnin
g

end:
while(x <= 12)
{
x++;
}
ASSEMBLY C
OLDER LANGUAGES STILL USED
2000
2000 - MOBILE
?
for (i = 0; i < m; i++) {
 

free(a[i])
;

}

free(a);
// Trick Question ! Nothing :)
C Java
* Famous Linus Torvalds C++ rant!
OLDER LANGUAGES STILL USED
2022
2022 - MOBILE
- Java 8 (circa 2022)
The reports of my death are greatly
exaggerated.
OLDER LANGUAGES STILL USED
4 MODERN JVM LANGUAGES
public class ObjectExample {




private int value;


private String name;




public ObjectExample(int value, String name) {


this.value = value;


this.name = name;


}




public String getName() {


return name;


}




public void setName(String name) {


this.name = name;


}




public int getValue() {




return value;


}




public void setValue(int value) {


this.value = value;


}




public static void main(String[] args) {




ObjectExample object = new ObjectExample(1,"Awesome");




System.out.println("Name " + object.getName() + " Value " + object.getValue());


}


}


Java -> Groovy Objects
class ObjectExample {


int value


String name


}




object = new ObjectExample(value:1,name:"Awesome")




println "Name $object.name Value $object.value"


implicit Getters/Setters
semi colons optional
parentheses optional
interpolated Strings
named properties in Constructor
static void main not needed
variable type optional
default static imports
public class ObjectExample {




private int value;


private String name;




public ObjectExample(int value, String name) {


this.value = value;


this.name = name;


}




public String getName() {


return name;


}




public void setName(String name) {


this.name = name;


}




public int getValue() {




return value;


}




public void setValue(int value) {


this.value = value;


}




}


Java -> Scala Objects
case class ObjectExample(value: Int, name: String)




public class ObjectExample {




private int value;


private String name;




public ObjectExample(int value, String name) {


this.value = value;


this.name = name;


}




public String getName() {


return name;


}




public void setName(String name) {


this.name = name;


}




public int getValue() {




return value;


}




public void setValue(int value) {


this.value = value;


}




}


Java 8 -> Java 14 Records
public record ObjectExample(int value, String name)




import java.util.Arrays;


import java.util.HashMap;


import java.util.List;


import java.util.Map;




public class Main {


public static void main(String[] args) {




List<Integer> someItems = Arrays.asList(new Integer[]{1, 2, 3, 4});


for (Integer item : someItems) {


System.out.println(item);


}


Map<String, String> someMapping = new HashMap<>();


someMapping.put("ST", "started");


someMapping.put("IP", "in progress");


someMapping.put("DN", "done");




for (Map.Entry<String, String> entry : someMapping.entrySet()) {


String key = entry.getKey();


String value = entry.getValue();


System.out.println(key + " => " + value);


}


}


}


Java -> Groovy Collections
def someItems = [1, 2, 3, 4]


someItems.each {


println it


}


def someMapping = ["ST": "started", "IP": "in progress", "DN": "done"]


someMapping.each { key, val ->


println "$key => $val"


}


collection literals
default collection imports
closure parameter def optional (it)
import java.sql.*;


import java.util.ArrayList;


import java.util.List;




public class JavaSqlExample {




static class Book {


public String name;


public int price;




public Book(String name, int price) {


this.name = name;


this.price = price;


}


}




public static void main(String[] args) throws SQLException{




List<Book> books = new ArrayList<>();




try (Connection con = DriverManager.getConnection("jdbc:h2:mem:")) {




con.prepareStatement("CREATE TABLE books " +


"AS SELECT 'Animal Farm' AS name, 123 AS price").execute();




try (ResultSet rs = con.prepareStatement("SELECT * FROM books").executeQuery()) {


while (rs.next()) {


books.add(new Book(rs.getString("name"), rs.getInt("price")));


}


}


}




books.forEach((book) -> System.out.println("Book " + book.name + " Price - " + book.price));




}


}


Java -> Groovy SQL
def sql = Sql.newInstance "jdbc:h2:mem:"




sql.execute """


CREATE TABLE books


AS SELECT 'Animal Farm' AS name, 123 AS price


"""




sql.rows "SELECT * FROM books" each {


println "Book - $it.name , Price - $it.price"


}




sql.close()


multiline strings
dynamic types
simpli
fi
ed SQL
BufferedReader br = new BufferedReader(new FileReader("file.txt"));


try {


StringBuilder sb = new StringBuilder();


String line = br.readLine();




while (line != null) {


sb.append(line);


sb.append(System.lineSeparator());


line = br.readLine();


}


String everything = sb.toString();


} finally {


br.close();


}


Java -> Groovy
everything = new File("file.txt").text


many built in convenience methods


(
fi
les, xml, json, rest, console)
Process p = new ProcessBuilder("ifconfig",
“en0").start();


BufferedReader br = new BufferedReader(new
InputStreamReader(p.getInputStream()));


String line = br.readLine();


while(line != null){


System.out.println(line);


line = br.readLine();


}


println "ifconfig en0".execute().text
Groovy Goodness
if ((1.1 + 0.1) == 1.2)


System.out.println("Matches in Groovy, NOT!! in Java");


big decimal by default
execute directly on Unix (#)
#!/usr/bin/env groovy


println("Hello world")


chmod +x helloWorl
d

./helloWorld
@Grab(group='org.springframework', module='spring', version='2.5.6')


import org.springframework.jdbc.core.JdbcTemplate


download dependencies
String.metaClass.shout = {


delegate.toUpperCase()


}




println "Hello!".shout()


add methods to existing classes
return optional
String version = "UNKNOWN";


if(computer != null){


Soundcard soundcard = computer.getSoundcard();


if(soundcard != null){


USB usb = soundcard.getUSB();


if(usb != null){


version = usb.getVersion();


}


}


}


Java -> Groovy
version = computer?.getSoundcard()?.getUSB()?.getVersion() ?: "UNKNOWN";


elvis operator (?:)
safe navigation operator (?.)
public List<String> decrypt(List<String> encryptedText) {


return encryptedText.stream()


.map(this::decryptText)


.collect(Collectors.toList());


}


public List<String> decrypt(List<String> encryptedText) {


return encryptedText*.decryptText


}
spread dot operator (*.)
Groovy Testing


(Power Asserts)
Condition not satisfied
:

'Grails Goodness' == course.descriptio
n

| |
|

| | Groovy Goodnes
s

| com.mrhaki.blog.Course@3435ec
9

fals
e

4 differences (73% similarity
)

Gr(ails) Goodnes
s

Gr(oovy) Goodness
assert 'Grails Goodness' == course.description


Groovy Testing (Spock)
def "addition test "()
{

when: "2 is added to 2"
int sum = 2 + 2
then: "sum should be 4"
sum == 4
}
Groovy Testing (Spock)
Parametrized Inputs
def "Data Drive test - minimum of #a and #b is #c"()
{

expect
:

Math.min(a, b) ==
c

where
:

a | b ||
c

3 | 7 || 3
5 | 4 || 4
9 | 9 || 9
}
Groovy Testing (Spock+Geb)


Web Application Testing
def "API example (non-Html content) -- health check"() {
given:
go "https://status.github.com/api/status.json"
expect
:

$('pre').text().startsWith('{"status":"good"'
)

}
Groovy Building (Gradle)
apply plugin:'java'


apply plugin:'checkstyle'


apply plugin:'findbugs'


apply plugin:'pmd'


version ='1.0'


repositories {


mavenCentral()


}


dependencies {


testCompile group:'junit', name:'junit', version:'4.11'


}
vs XML Building (Maven)
<plugin>


<groupId>org.apache.maven.plugins</groupId>


<artifactId>maven-checkstyle-plugin</artifactId>


<version>2.12.1</version>


<executions>


<execution>


<configuration>


<configLocation>config/checkstyle/checkstyle.xml</configLocation>


<consoleOutput>true</consoleOutput>


<failsOnError>true</failsOnError>


</configuration>


<goals>


<goal>check</goal>


</goals>


</execution>


</executions>


</plugin>


<plugin>


<groupId>org.codehaus.mojo</groupId>


<artifactId>findbugs-maven-plugin</artifactId>


<version>2.5.4</version>


<executions>


<execution>


<goals>


<goal>check</goal>


</goals>


</execution>


</executions>


</plugin>


<plugin>


<groupId>org.apache.maven.plugins</groupId>


<artifactId>maven-pmd-plugin</artifactId>


<version>3.1</version>


<executions>


<execution>


<goals>


<goal>check</goal>


</goals>


</execution>


</executions>


</plugin>
Groovy Building (Gradle)


Signi
fi
cant Performance over Maven
Java 10+ Type Inference
var list = new ArrayList<String>(); // infers ArrayList<String
>

var stream = list.stream(); // infers Stream<String>
Java 13+ Switch Expressions
switch (day)
{

case MONDAY, FRIDAY, SUNDAY -> System.out.println(6)
;

case TUESDAY -> System.out.println(7)
;

case THURSDAY, SATURDAY -> System.out.println(8)
;

case WEDNESDAY -> System.out.println(9)
;

}
Java 15+ Text Blocks
public String textBlocks()
{

    return ""
"

        Get busy livin
g

        o
r

        get busy dying
.

        --Stephen King"""
;

}
Led to innumerable errors, vulnerabilities, and
system crashes, which have probably caused a
billion dollars of pain and damage in the last forty
years.
Tony Hoare
(on his invention of the null reference)
Kotlin - True Null Safety
var a: String = "abc"
a = null // compilation error
WHICH JVM LANGUAGE TO USE ?
(AND WHY STICK TO THE JVM?)
▸Steep Learning Curve


▸Compatibility Issues


▸Lackluster IDE Support


▸Negative Market Trend


▸Including Companies moving back to Java (including Twitter)


▸Opinion -> Strong Pass *
SCALA
Rare niches aside (Big Data)
GROOVY
▸Easy Learning Curve


▸Strong Industry and IDE Support (JetBrains/Google)


▸Dynamic Typing (a double edged sword)


▸Slowed Adoption


▸Opinion -> Consider (for build scripts and testing)


▸Prefer Gradle over Maven :)
▸Strong Industry and IDE Support


▸Modern Java 19+ features have still no caught up
with alternatives


▸Opinion -> Consider
JAVA 19+ (OR 8)
▸Easy Learning Curve


▸Strong Industry and IDE Support (JetBrains/Google)


▸True Null Safety


▸Gradle Scripts can be written in Kotlin


▸Opinion -> Strong Consider (especially for Android)
KOTLIN
IaaS
Bare-Metal
PaaS
FaaS (sometimes)
CaaS
(i.e. Kubernetes)
Productivity


+ Abstraction
C
Assembly
Java
Kotlin
Productivity


+ Abstraction
(sometimes)
▸Abstraction as a Core Productivity Accelerator


▸Diminishing returns with Higher Level Languages


▸Stronger returns are often elsewhere (frameworks, cloud, etc)


▸Consider Kotlin / Groovy (testing / building) / Scala as JVM
alternatives


▸Java isn’t going away
TAKEAWAYS
ADDITIONAL MATERIAL

Weitere ähnliche Inhalte

Ähnlich wie The Future of JVM Languages

Intro to scala
Intro to scalaIntro to scala
Intro to scalaJoe Zulli
 
Ast transformations
Ast transformationsAst transformations
Ast transformationsHamletDRC
 
Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Jesper Kamstrup Linnet
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Codemotion
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good codeGiordano Scalzo
 
[2019-07] GraphQL in depth (serverside)
[2019-07] GraphQL in depth (serverside)[2019-07] GraphQL in depth (serverside)
[2019-07] GraphQL in depth (serverside)croquiscom
 
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Codemotion
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6Solution4Future
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Sunghyouk Bae
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 SpringKiyotaka Oku
 

Ähnlich wie The Future of JVM Languages (20)

Scala - en bedre Java?
Scala - en bedre Java?Scala - en bedre Java?
Scala - en bedre Java?
 
Groovy
GroovyGroovy
Groovy
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
Ast transformations
Ast transformationsAst transformations
Ast transformations
 
Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?
 
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017 Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
Davide Cerbo - Kotlin: forse è la volta buona - Codemotion Milan 2017
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good code
 
Groovy intro for OUDL
Groovy intro for OUDLGroovy intro for OUDL
Groovy intro for OUDL
 
[2019-07] GraphQL in depth (serverside)
[2019-07] GraphQL in depth (serverside)[2019-07] GraphQL in depth (serverside)
[2019-07] GraphQL in depth (serverside)
 
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
 
JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6
 
Java.lang.object
Java.lang.objectJava.lang.object
Java.lang.object
 
Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017Kotlin @ Coupang Backend 2017
Kotlin @ Coupang Backend 2017
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 

Mehr von VictorSzoltysek

Simplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI APISimplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI APIVictorSzoltysek
 
From SpaceX Launch Pads to Rapid Deployments
From SpaceX Launch Pads to Rapid DeploymentsFrom SpaceX Launch Pads to Rapid Deployments
From SpaceX Launch Pads to Rapid DeploymentsVictorSzoltysek
 
Driving Process Improvements - A Guided Approach to Running Effective Retrosp...
Driving Process Improvements - A Guided Approach to Running Effective Retrosp...Driving Process Improvements - A Guided Approach to Running Effective Retrosp...
Driving Process Improvements - A Guided Approach to Running Effective Retrosp...VictorSzoltysek
 
Spaceships, Pull Requests and Feature Branching - A Principles-Based approac...
Spaceships, Pull Requests and Feature Branching  - A Principles-Based approac...Spaceships, Pull Requests and Feature Branching  - A Principles-Based approac...
Spaceships, Pull Requests and Feature Branching - A Principles-Based approac...VictorSzoltysek
 
Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...
Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...
Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...VictorSzoltysek
 
Real-World Application Observability - 11 Practical Developer Focused Tips
Real-World Application Observability - 11 Practical Developer Focused TipsReal-World Application Observability - 11 Practical Developer Focused Tips
Real-World Application Observability - 11 Practical Developer Focused TipsVictorSzoltysek
 
Victor's Awesome Retro Deck
Victor's Awesome Retro DeckVictor's Awesome Retro Deck
Victor's Awesome Retro DeckVictorSzoltysek
 
Software Development in Internet Memes
Software Development in Internet MemesSoftware Development in Internet Memes
Software Development in Internet MemesVictorSzoltysek
 
Big Bangs, Monorails and Microservices - Feb 2020
Big Bangs, Monorails and Microservices - Feb 2020Big Bangs, Monorails and Microservices - Feb 2020
Big Bangs, Monorails and Microservices - Feb 2020VictorSzoltysek
 
Making your RDBMS fast!
Making your RDBMS fast! Making your RDBMS fast!
Making your RDBMS fast! VictorSzoltysek
 
SQL Tips + Tricks for Developers
SQL Tips + Tricks for DevelopersSQL Tips + Tricks for Developers
SQL Tips + Tricks for DevelopersVictorSzoltysek
 
Less is more the 7 wastes of lean software development
Less is more   the 7 wastes of lean software developmentLess is more   the 7 wastes of lean software development
Less is more the 7 wastes of lean software developmentVictorSzoltysek
 
Modern day jvm controversies
Modern day jvm controversiesModern day jvm controversies
Modern day jvm controversiesVictorSzoltysek
 
The Future of Java - and a look at the evolution of programming languages
The Future of Java - and a look at the evolution of programming languagesThe Future of Java - and a look at the evolution of programming languages
The Future of Java - and a look at the evolution of programming languagesVictorSzoltysek
 
Client Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future ReplacementClient Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future ReplacementVictorSzoltysek
 
Improving velocity through abstraction
Improving velocity through abstractionImproving velocity through abstraction
Improving velocity through abstractionVictorSzoltysek
 

Mehr von VictorSzoltysek (16)

Simplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI APISimplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI API
 
From SpaceX Launch Pads to Rapid Deployments
From SpaceX Launch Pads to Rapid DeploymentsFrom SpaceX Launch Pads to Rapid Deployments
From SpaceX Launch Pads to Rapid Deployments
 
Driving Process Improvements - A Guided Approach to Running Effective Retrosp...
Driving Process Improvements - A Guided Approach to Running Effective Retrosp...Driving Process Improvements - A Guided Approach to Running Effective Retrosp...
Driving Process Improvements - A Guided Approach to Running Effective Retrosp...
 
Spaceships, Pull Requests and Feature Branching - A Principles-Based approac...
Spaceships, Pull Requests and Feature Branching  - A Principles-Based approac...Spaceships, Pull Requests and Feature Branching  - A Principles-Based approac...
Spaceships, Pull Requests and Feature Branching - A Principles-Based approac...
 
Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...
Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...
Real-World DevOps — 20 Practical Developers Tips for Tightening Your Operatio...
 
Real-World Application Observability - 11 Practical Developer Focused Tips
Real-World Application Observability - 11 Practical Developer Focused TipsReal-World Application Observability - 11 Practical Developer Focused Tips
Real-World Application Observability - 11 Practical Developer Focused Tips
 
Victor's Awesome Retro Deck
Victor's Awesome Retro DeckVictor's Awesome Retro Deck
Victor's Awesome Retro Deck
 
Software Development in Internet Memes
Software Development in Internet MemesSoftware Development in Internet Memes
Software Development in Internet Memes
 
Big Bangs, Monorails and Microservices - Feb 2020
Big Bangs, Monorails and Microservices - Feb 2020Big Bangs, Monorails and Microservices - Feb 2020
Big Bangs, Monorails and Microservices - Feb 2020
 
Making your RDBMS fast!
Making your RDBMS fast! Making your RDBMS fast!
Making your RDBMS fast!
 
SQL Tips + Tricks for Developers
SQL Tips + Tricks for DevelopersSQL Tips + Tricks for Developers
SQL Tips + Tricks for Developers
 
Less is more the 7 wastes of lean software development
Less is more   the 7 wastes of lean software developmentLess is more   the 7 wastes of lean software development
Less is more the 7 wastes of lean software development
 
Modern day jvm controversies
Modern day jvm controversiesModern day jvm controversies
Modern day jvm controversies
 
The Future of Java - and a look at the evolution of programming languages
The Future of Java - and a look at the evolution of programming languagesThe Future of Java - and a look at the evolution of programming languages
The Future of Java - and a look at the evolution of programming languages
 
Client Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future ReplacementClient Technical Analysis of Legacy Software and Future Replacement
Client Technical Analysis of Legacy Software and Future Replacement
 
Improving velocity through abstraction
Improving velocity through abstractionImproving velocity through abstraction
Improving velocity through abstraction
 

Kürzlich hochgeladen

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

The Future of JVM Languages

  • 1. THE FUTURE OF JVM LANGUAGES AND THE EVOLUTION OF PROGRAMMING LANGUAGES Victor Szoltysek
  • 2. 4 MODERN JVM LANGUAGES
  • 5. - Margaret Hamilton (with stacks of assembly code she wrote for the first moon landing mission)
  • 6.
  • 7. ? 43 00 00 00 inc ebx MACHINE CODE ASSEMBLY
  • 8.
  • 9. No matter the programming language chosen, a professional developer will write an average of 10 lines of code (LoC) day. Frederick Brooks
  • 10. 1980
  • 12. ? mov eax, $ x cmp eax, 0x0C jg en d beginning: inc eax cmp eax, 0x0C jle beginnin g end: while(x <= 12) { x++; } ASSEMBLY C
  • 14. 2000
  • 16. ? for (i = 0; i < m; i++) { free(a[i]) ; } free(a); // Trick Question ! Nothing :) C Java
  • 17.
  • 18. * Famous Linus Torvalds C++ rant! OLDER LANGUAGES STILL USED
  • 19. 2022
  • 21. - Java 8 (circa 2022) The reports of my death are greatly exaggerated. OLDER LANGUAGES STILL USED
  • 22. 4 MODERN JVM LANGUAGES
  • 23. public class ObjectExample { 
 
 private int value; 
 private String name; 
 
 public ObjectExample(int value, String name) { 
 this.value = value; 
 this.name = name; 
 } 
 
 public String getName() { 
 return name; 
 } 
 
 public void setName(String name) { 
 this.name = name; 
 } 
 
 public int getValue() { 
 
 return value; 
 } 
 
 public void setValue(int value) { 
 this.value = value; 
 } 
 
 public static void main(String[] args) { 
 
 ObjectExample object = new ObjectExample(1,"Awesome"); 
 
 System.out.println("Name " + object.getName() + " Value " + object.getValue()); 
 } 
 } 
 Java -> Groovy Objects class ObjectExample { 
 int value 
 String name 
 } 
 
 object = new ObjectExample(value:1,name:"Awesome") 
 
 println "Name $object.name Value $object.value" implicit Getters/Setters semi colons optional parentheses optional interpolated Strings named properties in Constructor static void main not needed variable type optional default static imports
  • 24. public class ObjectExample { 
 
 private int value; 
 private String name; 
 
 public ObjectExample(int value, String name) { 
 this.value = value; 
 this.name = name; 
 } 
 
 public String getName() { 
 return name; 
 } 
 
 public void setName(String name) { 
 this.name = name; 
 } 
 
 public int getValue() { 
 
 return value; 
 } 
 
 public void setValue(int value) { 
 this.value = value; 
 } 
 
 } 
 Java -> Scala Objects case class ObjectExample(value: Int, name: String) 
 

  • 25. public class ObjectExample { 
 
 private int value; 
 private String name; 
 
 public ObjectExample(int value, String name) { 
 this.value = value; 
 this.name = name; 
 } 
 
 public String getName() { 
 return name; 
 } 
 
 public void setName(String name) { 
 this.name = name; 
 } 
 
 public int getValue() { 
 
 return value; 
 } 
 
 public void setValue(int value) { 
 this.value = value; 
 } 
 
 } 
 Java 8 -> Java 14 Records public record ObjectExample(int value, String name) 
 

  • 26. import java.util.Arrays; 
 import java.util.HashMap; 
 import java.util.List; 
 import java.util.Map; 
 
 public class Main { 
 public static void main(String[] args) { 
 
 List<Integer> someItems = Arrays.asList(new Integer[]{1, 2, 3, 4}); 
 for (Integer item : someItems) { 
 System.out.println(item); 
 } 
 Map<String, String> someMapping = new HashMap<>(); 
 someMapping.put("ST", "started"); 
 someMapping.put("IP", "in progress"); 
 someMapping.put("DN", "done"); 
 
 for (Map.Entry<String, String> entry : someMapping.entrySet()) { 
 String key = entry.getKey(); 
 String value = entry.getValue(); 
 System.out.println(key + " => " + value); 
 } 
 } 
 } 
 Java -> Groovy Collections def someItems = [1, 2, 3, 4] 
 someItems.each { 
 println it 
 } 
 def someMapping = ["ST": "started", "IP": "in progress", "DN": "done"] 
 someMapping.each { key, val -> 
 println "$key => $val" 
 } collection literals default collection imports closure parameter def optional (it)
  • 27. import java.sql.*; 
 import java.util.ArrayList; 
 import java.util.List; 
 
 public class JavaSqlExample { 
 
 static class Book { 
 public String name; 
 public int price; 
 
 public Book(String name, int price) { 
 this.name = name; 
 this.price = price; 
 } 
 } 
 
 public static void main(String[] args) throws SQLException{ 
 
 List<Book> books = new ArrayList<>(); 
 
 try (Connection con = DriverManager.getConnection("jdbc:h2:mem:")) { 
 
 con.prepareStatement("CREATE TABLE books " + 
 "AS SELECT 'Animal Farm' AS name, 123 AS price").execute(); 
 
 try (ResultSet rs = con.prepareStatement("SELECT * FROM books").executeQuery()) { 
 while (rs.next()) { 
 books.add(new Book(rs.getString("name"), rs.getInt("price"))); 
 } 
 } 
 } 
 
 books.forEach((book) -> System.out.println("Book " + book.name + " Price - " + book.price)); 
 
 } 
 } 
 Java -> Groovy SQL def sql = Sql.newInstance "jdbc:h2:mem:" 
 
 sql.execute """ 
 CREATE TABLE books 
 AS SELECT 'Animal Farm' AS name, 123 AS price 
 """ 
 
 sql.rows "SELECT * FROM books" each { 
 println "Book - $it.name , Price - $it.price" 
 } 
 
 sql.close() multiline strings dynamic types simpli fi ed SQL
  • 28. BufferedReader br = new BufferedReader(new FileReader("file.txt")); 
 try { 
 StringBuilder sb = new StringBuilder(); 
 String line = br.readLine(); 
 
 while (line != null) { 
 sb.append(line); 
 sb.append(System.lineSeparator()); 
 line = br.readLine(); 
 } 
 String everything = sb.toString(); 
 } finally { 
 br.close(); 
 } 
 Java -> Groovy everything = new File("file.txt").text many built in convenience methods ( fi les, xml, json, rest, console) Process p = new ProcessBuilder("ifconfig", “en0").start(); 
 BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); 
 String line = br.readLine(); 
 while(line != null){ 
 System.out.println(line); 
 line = br.readLine(); 
 } println "ifconfig en0".execute().text
  • 29. Groovy Goodness if ((1.1 + 0.1) == 1.2) 
 System.out.println("Matches in Groovy, NOT!! in Java"); big decimal by default execute directly on Unix (#) #!/usr/bin/env groovy 
 println("Hello world") chmod +x helloWorl d ./helloWorld @Grab(group='org.springframework', module='spring', version='2.5.6') 
 import org.springframework.jdbc.core.JdbcTemplate download dependencies String.metaClass.shout = { 
 delegate.toUpperCase() 
 } 
 
 println "Hello!".shout() add methods to existing classes return optional
  • 30. String version = "UNKNOWN"; 
 if(computer != null){ 
 Soundcard soundcard = computer.getSoundcard(); 
 if(soundcard != null){ 
 USB usb = soundcard.getUSB(); 
 if(usb != null){ 
 version = usb.getVersion(); 
 } 
 } 
 } Java -> Groovy version = computer?.getSoundcard()?.getUSB()?.getVersion() ?: "UNKNOWN"; elvis operator (?:) safe navigation operator (?.) public List<String> decrypt(List<String> encryptedText) { 
 return encryptedText.stream() 
 .map(this::decryptText) 
 .collect(Collectors.toList()); 
 } public List<String> decrypt(List<String> encryptedText) { 
 return encryptedText*.decryptText 
 } spread dot operator (*.)
  • 31. Groovy Testing (Power Asserts) Condition not satisfied : 'Grails Goodness' == course.descriptio n | | | | | Groovy Goodnes s | com.mrhaki.blog.Course@3435ec 9 fals e 4 differences (73% similarity ) Gr(ails) Goodnes s Gr(oovy) Goodness assert 'Grails Goodness' == course.description 

  • 32. Groovy Testing (Spock) def "addition test "() { when: "2 is added to 2" int sum = 2 + 2 then: "sum should be 4" sum == 4 }
  • 33. Groovy Testing (Spock) Parametrized Inputs def "Data Drive test - minimum of #a and #b is #c"() { expect : Math.min(a, b) == c where : a | b || c 3 | 7 || 3 5 | 4 || 4 9 | 9 || 9 }
  • 34. Groovy Testing (Spock+Geb) Web Application Testing def "API example (non-Html content) -- health check"() { given: go "https://status.github.com/api/status.json" expect : $('pre').text().startsWith('{"status":"good"' ) }
  • 35. Groovy Building (Gradle) apply plugin:'java' apply plugin:'checkstyle' apply plugin:'findbugs' apply plugin:'pmd' version ='1.0' repositories { mavenCentral() } dependencies { testCompile group:'junit', name:'junit', version:'4.11' }
  • 36. vs XML Building (Maven) <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.12.1</version> <executions> <execution> <configuration> <configLocation>config/checkstyle/checkstyle.xml</configLocation> <consoleOutput>true</consoleOutput> <failsOnError>true</failsOnError> </configuration> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.5.4</version> <executions> <execution> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>3.1</version> <executions> <execution> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin>
  • 37. Groovy Building (Gradle) Signi fi cant Performance over Maven
  • 38. Java 10+ Type Inference var list = new ArrayList<String>(); // infers ArrayList<String > var stream = list.stream(); // infers Stream<String>
  • 39. Java 13+ Switch Expressions switch (day) { case MONDAY, FRIDAY, SUNDAY -> System.out.println(6) ; case TUESDAY -> System.out.println(7) ; case THURSDAY, SATURDAY -> System.out.println(8) ; case WEDNESDAY -> System.out.println(9) ; }
  • 40. Java 15+ Text Blocks public String textBlocks() {     return "" "         Get busy livin g         o r         get busy dying .         --Stephen King""" ; }
  • 41. Led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. Tony Hoare (on his invention of the null reference)
  • 42. Kotlin - True Null Safety var a: String = "abc" a = null // compilation error
  • 43. WHICH JVM LANGUAGE TO USE ? (AND WHY STICK TO THE JVM?)
  • 44. ▸Steep Learning Curve ▸Compatibility Issues ▸Lackluster IDE Support ▸Negative Market Trend ▸Including Companies moving back to Java (including Twitter) ▸Opinion -> Strong Pass * SCALA Rare niches aside (Big Data)
  • 45. GROOVY ▸Easy Learning Curve ▸Strong Industry and IDE Support (JetBrains/Google) ▸Dynamic Typing (a double edged sword) ▸Slowed Adoption ▸Opinion -> Consider (for build scripts and testing) ▸Prefer Gradle over Maven :)
  • 46. ▸Strong Industry and IDE Support ▸Modern Java 19+ features have still no caught up with alternatives ▸Opinion -> Consider JAVA 19+ (OR 8)
  • 47. ▸Easy Learning Curve ▸Strong Industry and IDE Support (JetBrains/Google) ▸True Null Safety ▸Gradle Scripts can be written in Kotlin ▸Opinion -> Strong Consider (especially for Android) KOTLIN
  • 50. ▸Abstraction as a Core Productivity Accelerator ▸Diminishing returns with Higher Level Languages ▸Stronger returns are often elsewhere (frameworks, cloud, etc) ▸Consider Kotlin / Groovy (testing / building) / Scala as JVM alternatives ▸Java isn’t going away TAKEAWAYS