Skip to content
0:00 / 0:00

#kotlin#java#librarydesign

KotlinConf 2018 - 10 Tips to Make Libraries Kotlin-Friendly by Kyle Thomson

JetBrains

236K subscribers • 29 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Kyle Thomson, Senior Engineer

Intermediate. Assumes working knowledge.

1.3K views8 years ago1 recommendation

Programming languagesSoftware designKotlinJava and the JVMAPI design

Kyle Thomson shares ten practical tips for designing Java libraries that provide an idiomatic and seamless experience for Kotlin developers.

Recording brought to you by American Express americanexpress.io/kotlin-jobs There's plenty out there about how to make Kotlin work well with Java - but what about the reverse? Do you want to appeal more to your Kotlin customers whilst maintaining an idiomatic experience for your Java customers? This session will cover 10(ish) tips and tricks you can apply to your Java library to make it more Kotlin-friendly without sacrificing usability for your Java customers. We'll look at case-studies of real open-source Java libraries and show you techniques you can apply to make your library play nicely within the Kotlin ecosystem. About the Presenter: Kyle Thomson is a senior engineer who spent a decade writing large-scale trading applications for banks before joining the AWS SDK team. He has a passion for open source and is currently a core maintainer for several of the open-sourced AWS tools. The majority of Kyle’s experience is in JVM languages (Java, Scala, Kotlin) but he’s also written enterprise software in Python, Perl, Objective-C and Ruby.

Why it's here

1 person recommends this

What people say. Recommended for developers looking to understand the idiomatic differences and interoperability between Java and Kotlin libraries.

u/snowe2010in r/Kotlin • Recommends

On “What are the idiomatic differences between Kotlin libraries and Java libraries? Is there a Kotlin way of creating library APIs?”

#For a Kotlin Library: ##Calling from Kotlin: ###Advantages: * named parameters * no ugly conversions between things like KClass and Class ##Calling from Java: ###Disadvantages: * no Kotlin features * unless the library is prepared for Java users (`@JvmStatic`) you might have trouble calling the library * dependencies on Kotlin even though you aren't using Kotlin #For a Java Library: ##Calling from Kotlin: ###Advantages: * you get null safety on many existing libraries, due to use of JSR-305 nullability annotations * you can convert between types like KClass and Class pretty easily ### Disadvantages: * Passing lambdas is more difficult in some cases * no support for named parame…