The Power of Gradle Kotlin DSL

The Power of Gradle Kotlin DSL

-The following is based on Gradle 4.3.1- A few weeks ago I started migrating most of my Groovy-based gradle.build scripts to Kotlin-backed gradle.build.kts scripts using the Kotlin DSL. Why would I do that? Kotlin is my language of choice and I love the idea of using a single language to do all my work. I …

Read More Read More

Web Applications with Kotlin ktor

Web Applications with Kotlin ktor

Disclaimer: This article was originally published in the Dzone Web Development Guide, which can be downloaded here. Introduction When Google made Kotlin an official language for Android a few months ago at Google I/O, the language gained a lot of popularity in the Android world quickly. On the server side though, Kotlin is not as …

Read More Read More

Kotlin Features I miss most in Java

Kotlin Features I miss most in Java

My Life as a Java Dev Although I’m a big supporter of the Kotlin programming language, I still do a lot of Java programming on a daily basis for my employer. Since I’m aware of the great functionalities of Kotlin, I’m often struggling with Java as it has some “pitfalls”, requires additional boilerplate and misses …

Read More Read More

Kotlin Reified Types in Inline Functions

Kotlin Reified Types in Inline Functions

I’ve noticed that many people haven’t ever heard of reified types or have problems understanding what they are, and what they do. Therefore this little post is intended to bring some light into the darkness of Kotlin’s reified types. Starting situation fun <T> myGenericFun(c: Class<T>) In an ordinary generic function like myGenericFun you can’t access …

Read More Read More

Creating your own DSL in Kotlin

Creating your own DSL in Kotlin

Motivation If you’ve been following my recent posts about Kotlin, you’ve probably noticed me mentioning Domain Specific Languages (DSL) already. Kotlin as a programming language provides some powerful features that allow us to create those DSLs. One of these features, I also already introduced, is called Function Literals with Receiver, others are the invoke convention or …

Read More Read More

Kotlin Conventions – Operator Overloading

Kotlin Conventions – Operator Overloading

Operator Overloading and Conventions in Kotlin 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. In this article I want to show you which conventions can be used and will provide some …

Read More Read More

Kotlin Coroutines Guide

Kotlin Coroutines Guide

Approaching Kotlin Coroutines – An Extensive Feature Concurrent Programming in Kotlin Introduction and Motivation As already advertised on Twitter a few days ago, I was planning to run the rule over Kotlin Coroutines, which I actually did. Unfortunately, this took me longer than first expected because coroutines are huge, especially if you’re not yet familiar with …

Read More Read More

Kotlin Function Literals with Receiver – Quick Introduction

Kotlin Function Literals with Receiver – Quick Introduction

Function Literals with Receiver – The Foundation for DSLs and many Library Functions Today I want to give a quick introduction to Function Literals with Receiver. This concept is what makes Kotlin great for designing Domain Specific Languages as we know it from Groovy for example. Also, Kotlins standard library includes many functions which many of you …

Read More Read More

Kotlin on the JVM – Bytecode Generation

Kotlin on the JVM – Bytecode Generation

Kotlin on the JVM – How can it provide so many features? Introduction What exactly is a “JVM language”? Isn’t only Java meant to be run on the JVM? Kotlin provides many features that aren’t available in Java such as a proper function type, extension functions or data classes. How was this even achievable? I’ve taken a …

Read More Read More