What if you could eliminate NullPointerExceptions at compile time? This session shows Java developers how to write safer, more concise code with Kotlin.
#1about 3 minutes
Introduction to Kotlin and its Java interoperability
Kotlin is a mature, multi-paradigm language that is fully interoperable with Java libraries and is used in production by major companies.
#2about 5 minutes
Defining variables and working with strings in Kotlin
Learn Kotlin's basic syntax for variables using `var` and `val`, how type inference simplifies code, and how to use string templates for concatenation.
#3about 5 minutes
Using expressions instead of statements for cleaner code
Kotlin treats control flow structures like `if-else`, `try-catch`, and the powerful `when` block as expressions that return a value, eliminating temporary variables.
#4about 7 minutes
Writing concise functions with named and default arguments
Simplify function definitions using expression bodies for single-line returns and avoid method overloading by using named and default arguments.
#5about 5 minutes
Iterating with loops, ranges, and collections
Use Kotlin's intuitive syntax for `for` loops with ranges (`..`, `until`, `downTo`) and iterate over immutable lists with index destructuring.
#6about 8 minutes
Achieving null safety with nullable types and operators
Prevent null pointer exceptions by using Kotlin's type system, which distinguishes between nullable and non-nullable types, along with the safe call (`?.`) and Elvis (`?:`) operators.
#7about 5 minutes
Applying functional programming with lambdas and collections
Define and use lambdas with a concise syntax, leveraging the implicit `it` parameter and trailing lambda syntax for clean collection operations like `filter`.
#8about 4 minutes
Extending existing classes with extension functions
Add new functionality to any existing class, including final Java classes, without using inheritance by defining extension functions.
#9about 4 minutes
Understanding classes, data classes, and operator overloading
Use `data class` to automatically generate `equals`, `hashCode`, and `toString`, and learn how operator overloading can create more readable code for types like `BigDecimal`.
#10about 11 minutes
Audience Q&A on Kotlin features and learning resources
The speaker answers audience questions about Kotlin's relationship to Scala, the potential dangers of operator overloading, and recommended learning resources.
Related jobs
Jobs that call for the skills explored in this talk.
WeAreDevelopers LIVE days are changing - get ready to take partStarting with this week's Web Dev Day edition of WeAreDevelopers LIVE Days, we changed the the way we run these online conferences. The main differences are:Shorter talks (half an hour tops)More interaction in Q&AA tips and tricks "Did you know" sect...