<< See All Talks

Expressive APIs with Kotlin

Voxxed Days Australian Tour: Sydney

17 May 2019, talk

We like when our code is easy to read and understand. It is indeed hard to design an API to be expressive enough for that. The popular approaches are builders or fluent APIs. Let’s see what one can achieve with the more expressive programming language?

Kotlin language grammar opens the way for it. Extension functions and lambdas are the very first steps in our way to make even exiting Java APIs more expressive. We start the talk with a basic introduction into Kotlin language. In the live coding session, we see, how a long Java code snippet with a builder is enlightened.

Configuration scripts, JSON, or XML are powerful examples of Kotlin APIs or DSLs in action. You’ll know existing libraries and see how to easily create your own APIs. We’ll see the HTML builder and React DOM builder APIs in action too.

From the talk, you will learn how to benefit from Kotlin language grammar to achieve the expressiveness of your code and APIs. You’ll no longer see the magic behind statically typed DSLs in Kotlin, but you will know libraries and patterns to bring it into your project


Feedback:

1

References:

Link
Slides
GitHub
comments powered by Disqus