Skip to main content

Contracts in Kotlin 1.3

·9 mins

Kotlin 1.3 is bringing a new experimental feature to the compiler to help with improving program correctness via the type-system: contracts.

Contracts are a tool that allow library code (both standard library and your libraries) hint to the compiler about the constraints that are ensured on types based on the use of functions in your program. Let’s see how this can be used in practice.

Highlighting Lines in Hugo Code Snippets

·2 mins

Hugo makes it quite simple to share code snippets with syntax highlighting on your site, but did you know you can highlight individual lines in code-snippets as well?

De-Structuring in Kotlin

·5 mins
Recently I wrote an article about de-structuring in TypeScript, and hinted that Kotlin has a similar feature, but in more of a “strongly typed” language style.