Slide 1

Slide 1 text

Kotlin Everywhere: Versatility and Efficiency in Software Development Makurdi Manuel Ernesto | @manuelernest0

Slide 2

Slide 2 text

Makurdi What is Kotlin

Slide 3

Slide 3 text

Kotlin is a cross-platform, statically typed, general-purpose programming language with type inference developed by JetBrains. Kotlin interoperates fully with Java, and it can be used to write Android apps, IOS apps*, web applications, and other types of software. Makurdi

Slide 4

Slide 4 text

Kotlin is a programming language that makes coding concise, cross-platform, and fun.

Slide 5

Slide 5 text

2016 2021 2022 2023 2024 Kotlin releases Kotlin 1.0 15 Feb Kotlin 1.8.20 “Lang ver 2.0” Kotlin 1.9.x K2 Beta Compose & KSP Kotlin 2.0 K2 Default Kotlin 1.7.0 K2 Alpha Kotlin 2.0 & K2 Kotlin 1.5

Slide 6

Slide 6 text

Highlights of Companies Adopting Kotlin

Slide 7

Slide 7 text

Makurdi Why Kotlin 🤔

Slide 8

Slide 8 text

Kotlin is designed to be fully interoperable with Java, allowing developers to leverage existing Java libraries, frameworks, and tools. Makurdi Interoperability with Java

Slide 9

Slide 9 text

Makurdi Calling Java from Kotlin import java.util.* fun demo(source: List) { val list = ArrayList() // 'for'-loops work for Java collections: for (item in source) { list.add(item) } // Operator conventions work as well: for (i in 0..source.size - 1) { list[i] = source[i] // get and set are called } }

Slide 10

Slide 10 text

Kotlin's syntax is concise and expressive, reducing boilerplate code and enhancing code readability. Makurdi Conciseness and Readability

Slide 11

Slide 11 text

Makurdi Data class /** * no need to define get, set, toString ... */ data class Address(var street: String, var streetNumber: Int, var postCode: String, var city: String, var country: Country)

Slide 12

Slide 12 text

Kotlin introduces coroutines, which simplify asynchronous programming and make it more readable. Makurdi Coroutines for Asynchronous Programming

Slide 13

Slide 13 text

Makurdi Async with Coroutines import kotlinx.coroutines.* suspend fun main() { // A function that can be suspended and resumed later val start = System.currentTimeMillis() coroutineScope { // Create a scope for starting coroutines for (i in 1..10) { launch { // Start 10 concurrent tasks delay(3000L - i * 300) // Pause their execution log(start, "Countdown: $i") } } } // Execution continues when all coroutines in the scope have finished log(start, "Liftoff!") }

Slide 14

Slide 14 text

Kotlin supports extension functions, allowing developers to add new functions to existing classes without modifying their source code. Makurdi Extension Functions

Slide 15

Slide 15 text

Makurdi Extension Functions fun MutableList.swap(index1: Int, index2: Int) { val tmp = this[index1] // 'this' corresponds to the list this[index1] = this[index2] this[index2] = tmp } val list = mutableListOf(1, 2, 3) list.swap(0, 2) // 'this' inside 'swap()' will hold the value of 'list'

Slide 16

Slide 16 text

KMP allows developers to share code between different platforms, such as JVM and native. Makurdi Multiplatform Development

Slide 17

Slide 17 text

The community around Kotlin is active, providing support, tutorials, and resources. Makurdi Growing Ecosystem

Slide 18

Slide 18 text

Makurdi Null Safety

Slide 19

Slide 19 text

Makurdi Null Safety Functional Programming Features

Slide 20

Slide 20 text

Makurdi Null Safety Functional Programming Features Tooling Support

Slide 21

Slide 21 text

Makurdi How Kotlin 🤔

Slide 22

Slide 22 text

Makurdi Kotlin for Android

Slide 23

Slide 23 text

Makurdi Kotlin for Android

Slide 24

Slide 24 text

Makurdi Kotlin for Android

Slide 25

Slide 25 text

Makurdi Compose function import androidx.compose.foundation.layout.Column @Composable fun MessageCard(msg: Message) { Column { Text(text = msg.author) Text(text = msg.body) } }

Slide 26

Slide 26 text

Makurdi Kotlin Multiplatform (KMP) Share a piece of logic

Slide 27

Slide 27 text

Makurdi Kotlin Multiplatform (KMP) Share logic and keep the UI native

Slide 28

Slide 28 text

Makurdi Kotlin Multiplatform (KMP) Share up to 100% of the code

Slide 29

Slide 29 text

Makurdi Server-side Combine the world’s most popular JVM framework with Kotlin and make the ultimate combo for application development.

Slide 30

Slide 30 text

Makurdi Server-side Ktor is a multiplatform toolkit built by JetBrains for creating Web applications in Kotlin. It makes use of coroutines for high scalability and offers an easy-to-use API.

Slide 31

Slide 31 text

Thanks Makurdi