Skip to content
0:00 / 0:00

#kotlin#puzzlers#jvm

KotlinConf 2018 - Kotlin Puzzlers, vol 2 by Anton Keks

JetBrains

236K subscribers • 29 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Anton Keks

Intermediate. Assumes working knowledge.

10K views8 years ago2 recommendations

Programming languagesKotlin

Anton Keks presents a series of Kotlin syntax and language feature puzzles to explain the language's unexpected behaviors.

Recording brought to you by American Express americanexpress.io/kotlin-jobs Kotlin is a marvelous language that makes programming on the JVM fun again. During the design phase of the language, it was said that Kotlin specifically tried to avoid some of the most famous Java Puzzlers. However, having so many advanced features in the language it cannot avoid introducing puzzlers of its own. This talk will present some of the more interesting nuances of syntax or language features with the help of small puzzler programs letting the audience guess their behavior. The mystery will then be revealed with an explanation in a fun way. Having received an overwhelmingly good feedback from the previous year, I am ready with a set of completely new puzzlers to entertain you among all these really serious talks! Don't miss this sequel to one of the highest rated talks of Kotlinconf 2017! About the Presenter: Anton Keks is a software craftsman, co-founder of Codeborne, the only extreme programming shop in the region, frequent speaker at conferences, and a lecturer in Tallinn Technical University. He is also a strong believer in open-source software and agile development methodologies, author of a popular network tool — Angry IP Scanner, and a regular contributor to other open-source projects. Before founding Codeborne, Anton has led a team of developers of the award-winning internet-bank of Swedbank for 5 years, gradually introducing agile methods. During this time he has also co-founded Agile Estonia non-profit organization that organizes regular agile conferences in Estonia. During spare time he plays guitar, rides motorbike and travels to remote corners of the world.

Why it's here

2 people recommend this

What people say. Engineers point to this talk to illustrate subtle quirks and unexpected behaviors in Kotlin syntax.

u/a_kiralyin r/Kotlin • Recommends

On “What are your concerns and pet peeves about Kotlin so far?”

That this doesn't compile and there is no plan to fix it: fun foo(a: Boolean, b: Boolean) = println("$a, $b") val a = 1 val b = 2 val c = 3 val d = 4 fun main() { foo(c < a, b > d) } (Credit to this video: link to this video ) Ternary operator would be nice. Recently found out that kotlin Duration is backed by floating point numbers with all the quirks that come with them. (Credit to the Kotlin Slack)

u/Sleepkeverin r/Kotlin • Recommends

On “I just discovered this is valid Kotlin”

And for an even more annoying example. Imagine this being somewhere in your codebase. val cells = arrayOf(arrayOf(1, 1, 1), arrayOf(0, 1, 1), arrayOf(1, 0, 1)) val neighbors = cells00 + cells01 + cells02 + cells10 + cells12 + cells20 + cells21 + cells22 println(neighbors) What is the value of neighbors printed? Hint: It's not 6. This is an example I saw at Kotlinconf a while back, credit goes to Kotlin Puzzlers, vol 2 by Anton Keks (12:55 for this one specifically). If you have a bit of Kotlin knowledge those puzzlers are really fun w…