5. “Indeed, the ratio of time spent reading
versus writing is well over 10 to 1. We are
constantly reading old code as part of the
effort to write new code. ...[Therefore,]
making it easy to read makes it easier to
write.”
Robert C. Martin, Clean Code: A Handbook of Agile
Software Craftsmanship
Intro you
Intro your experience as a Java developer
Talk about how you were never bothered by boilerplace
Managers can leave now
Duplication; convention (get); not needed (new, ;); messy (final)
Java has crap loads of boilerplate
Kotlin less
The REPL less (not even semi colons!)
Code generation is fine for <9
REPL optimises for writability
Java 5: Generics
Java 7: Diamond operator
Java 10: Local-variable type inference
Kotlin: var & val
Java 5: Generics
Java 7: Diamond operator
Java 10: Local-variable type inference
Kotlin: var & val
Java 5: Generics
Java 7: Diamond operator
Java 10: Local-variable type inference
Kotlin: var & val
Java 5: Generics
Java 7: Diamond operator
Java 10: Local-variable type inference
Kotlin: var & val
Modern Java is much improved
Kotlin tries to remove everything you don’t need
Live demo of generating the code?
Kotlin version
Turn on code folding (properties, then methods)
Writing is fine, reading is terrible
Kotlin’s List is automatically read only, has mutable list otherwise. Easier to tell when reading
Java’s list gives a runtime error if you try to add anything to it
Kotlin’s List is automatically read only, has mutable list otherwise. Easier to tell when reading
Java’s list gives a runtime error if you try to add anything to it
Can be slideware
On the other hand, IntelliJ does a good job of generating and hiding the code here
Slideware for the summary?
Can be slideware
On the other hand, IntelliJ does a good job of generating and hiding the code here
Slideware for the summary?
Java 5: Generics
Java 7: Diamond operator
Java 10: Local-variable type inference
Kotlin: var & val
Java 5: Generics
Java 7: Diamond operator
Java 10: Local-variable type inference
Kotlin: var & val