Kotlin

Previously, I had posted the types of features I would want in Java, while largely keeping the Java syntax. This was the post where I write about my initial discovery of Kotlin and how it almost perfectly met that list.

One of the coolest things Kotlin has to offer is type-safe builders, built upon several simple features. I find myself really really wanting to have this feature in my other two primary languages, Java and Python. This article explains what I believe to be the closest we can get to having type-safe builders in those languages.

Kotlin’s when expressions can be somewhat looked at as a pattern-matching system in Python, but it is by no means as fully-featured at true pattern matching systems in languages that have it. This shows a small technique that shows a little more of what’s possible with the when expression, even though, after learning more about real pattern matching, it clearly doesn’t actually work any more or less like actual pattern matching.