KotlinConf’23 — Why code autocompletion works faster on weekends by Egor Tolstoy
Egor Tolstoy, recently delivered an intriguing lightning talk about the work he does as a product manager on Kotlin.
As an example, he touched on the subject of range operators, ..
and until
, in the language and as part of the journey showed some interesting stats of their use.
Of course, as highlighted, when we see the use of the range operators is it clear what they mean? For instance, what do each of these lines print?
println((1..4).toList())
println((1 until 4).toList())
The answer to the above is:
[1, 2, 3, 4] // 1..4 is a closed range so end is inclusive
[1, 2, 3] // 1 until 4 is an open range so end is exclusive
The talk nicely emphasised the usefulness of testing peoples understanding of Kotlin code to drive how the language evolves, with the outcome of the above leading to the introduction of the new rangeUntil
operator, ..<
, which will become stable in Kotlin 1.9.0.
1..4 // 1, 2, 3, 4
1..<4 // 1, 2, 3
Of course that leaves one final question, why does code autocompletion work faster at the weekends?
Because developers typically work on smaller personal projects at weekends.
You can find my thoughts on more KotlinConf’23 talks at KotlinConf’23. Please let me know your thoughts.
Join medium to read all of my articles or subscribe for e-mail updates.