KotlinConf ’23 Recap
KotlinConf is JetBrains’ main event for developers interested in the Kotlin programming language and related technologies. It includes talks, workshops, and networking opportunities. For ’23, the event was held in Amsterdam.
KotlinConf lets us see once again how the number of Kotlin repositories on Github has been consistently growing significantly.
Kotlin Everywhere!
Is it true that Kotlin’s great adoption has been largely due to Android? In the following graph we can get an idea of the usage proportions.
Kotlin is in 95% of the most used apps in the Play Store 🙀
Google uses Kotlin extensively in its projects. As indicated in this article, 45% of its engineers use Kotlin and are creating integrations for all their tools so that they can be used with Kotlin.
Kotlin 2.0 is getting closer with performance improvements in compilation times. We will have a next version 1.9 and then we will have version 1̶.̶1̶0̶ 2.0.
The kotlin team has taken the feedback from the community very seriously and has been working on a new architecture for K2 Compiler that reduces the bottleneck presented in the compiler frond end.
The frontend is the part of the compiler that parses your code and performs the semantic analysis, data flow analysis, call resolution, and type inference. This is the part of the compiler that you, the developer, interact with the most. It’s also the part of the compiler that continuously runs inside your IDE, reports all error and warning messages, and helps you with tasks like auto completion, semantic-aware inspections, intentions, and refactorings
— Roman Elizarov
After approximately one year since the official launch of Jetpack Compose, we already have 23% of the apps in the Play Store using Jetpack Compose.
Kotlin DSL
Groovy will accompany Java in sharing the second place, in the upcoming versions of Android Studio we will have Kotlin DSL by default.
Most Desired Features
Static Extensions
Currently, if we want to add a static function to a class through an extension, it is necessary to have a companion object defined within the class.
For example:
fun main() {
MyFile.greet("Hello from Kotlin")
}
fun MyFile.Companion.greet(message: String) {
println(message)
}
class MyFile {
companion object {
// empty companion object body
}
}
But this is not the case when we want to apply it to third-party classes, we don’t have the possibility to do it.
So suppose that we want to create a static extension for the File class our code would not compile with the following:
So static extensions provide a solution for those cases using the syntax:
Collection Literals
Collection literals are a commonly utilized characteristic in modern programming languages such as Python, JS, Go, Swift, and Rust, to mention just a few examples. Without collection literals you’ll have to remember, by heart, a separate function to create each type of collection. listOf, mapOf, setOf, intArrayOf, etc.
Name-Based Destructuring
In Kotlin you can unstructure a class into variables, the problem is very easy to make mistakes when the order of the properties is inverted, for example being the product of a refactor, the kotlin team is working on solving this and it is possible that it will come out after kotlin version 2.0
Context Receivers
Since its release in the experimental phase in kotlin 1.6.20, a lot of feedback has been obtained and they hope to have a stable version in the first versions of kotlin 2.0
you can check more here
Explicit Fields
Explicit Fields solve the problem of creating redundant properties within a class by defining a single property instead of separate mutable and immutable properties.
Kotlin Multiplatform
Kotlin Multiplatform is here to stay! The idea is to have its stable ecosystem by 2024.
Compose Multiplatform
Two important announcements:
The first is that Compose for Desktop is already stable.
The second is that Compose Multiplatform is now targeting iOS!
If you like my content and want to support my work, you can give me a cup of coffee ☕️ 🥰
Follow me in
- Twitter: @devjcastro
- Linkedin: devjcastro