Kotlin Tutorial – Quick Reference – Getting Started with Kotlin

Kotlin Tutorial – Quick Reference – Getting Started with Kotlin

Functional Programming, Kotlin, Software Development, Tutorial
Introduction Disclaimer: This reference has originally been published as a DZone Refcard. Kotlin has become one of the most popular JVM languages in the past few months. One special reason is that it experienced a lot of attention in the Android community after Google made Kotlin an official language for Android development. Kotlin is being developed by JetBrains, who are responsible for the most famous IDEs out there, most notably IntelliJ IDEA. Nevertheless, it's an open source language, which can be found on GitHub. The language is said to be very concise, safe in terms of error frequency, interoperable with Java and also offers many features that enable functional programming, writing type-safe DSLs and much more. Beside the JVM, Kotlin can compile for most Android versions, down to machine code…
Read More
Kotlin Operator Overloading – Working by Convention

Kotlin Operator Overloading – Working by Convention

Functional Programming, Kotlin, Software Development, Tutorial
Kotlin Operator Overloading and Conventions Introduction Kotlin supports a technique called conventions, everyone should be familiar with. For example, if you define a special method plus in your class, you can use the + operator by convention: Kotlin Operator Overloading. In this article, I want to show you which conventions you can use and I will also provide a few Kotlin code examples that demonstrate the concepts. (more…)
Read More
Kotlin Coroutines Guide – Concurrent Programming in Kotlin

Kotlin Coroutines Guide – Concurrent Programming in Kotlin

Functional Programming, Java, Kotlin
updated 10/29/2018 Introduction and Motivation In this article, you will learn about Kotlin Coroutines: What they are, what they look like, and how they work. The demonstrated code examples were tested with Kotlin 1.3.0 and kotlinx.coroutines 1.0.0. Kotlin coroutines are one of the "bigger features" as indicated by the following quote, taken from JetBrains' blog: We all know that blocking is bad under a high load, that polling is a no-go, and the world is becoming more and more push-based and asynchronous. Many languages (starting with C# in 2012) support asynchronous programming through dedicated language constructs such as async/await keywords. In Kotlin, we generalized this concept so that libraries can define their versions of such constructs, and async is not a keyword, but merely a function. This design allows the…
Read More
Kotlin Sealed Class – An Explanation

Kotlin Sealed Class – An Explanation

Kotlin, Software Development, Uncategorized
Today I came across the Kotlin Sealed Class which I had never heard of before. After some research, I found that this concept is nothing new and is also available in Scala for example. So, yet another Scala feature JetBrains considered relevant and suitable for Kotlin? I like that :) Read this post if you're interested in more Kotlin features. Actually, this is a quite simple feature, which I'm going to explain in the following. Kotlin Sealed Class - Feature Explanation A sealed class can be subclassed and may include abstract methods, which means that sealed classes are abstract implicitly, although the documentation doesn't clearly say so. To actually make a class "sealed" we have to put the sealed modifier before its name, as we can see here: sealed class MyClass Restriction The…
Read More
Setup Vert.x Application written in Kotlin with Gradle – Kotlin Reactive Programming

Setup Vert.x Application written in Kotlin with Gradle – Kotlin Reactive Programming

Java, Kotlin, Software Development
I decided to write a Vert.x application in combination with Kotlin in a simple example because I’m really interested in Reactive Programming and love to use Kotlin. In this post, I will give some basic information on Vert.x as a tool set for writing reactive applications on the JVM and also introduce Kotlin a bit. In the end, I want to demonstrate how this application can be set up in Gradle. (more…)
Read More