How to create Maps in Kotlin using 5 different factory functions

Maps are a key collection type in most languages out there, so the ease of using them should be a given. In Kotlin, the collection API has been carefully created to make our job easier when working with collections. The syntax is concise, but still readable, and a huge set…


Kotlin: How to use default parameters in functions and constructors

From time to time you can end up having functions or constructors where the amount of information available varies for different usages. In these scenarios we want to be flexible enough that we can use the function even if we can't provide values for all the parameters. In Java this…




How to smoothly develop node modules locally using npm link

So you've found a small piece of code that is a perfect candidate to become a reusable node module. You extract the code into a module, but then begs the question — how can you test the module locally in a project? JavaScript is all about modules nowadays. With minimal effort…


Java 9 & 10: 4 new methods in the Optional API

One of the coolest things that where introduced in Java 8 was the Optional API. I've earlier written about how Optional can clean up your code. In short terms, Optional is a container object that may or may not contain a non-null value. It also offers a great range of…