The Indico Data team has been busy making improvements to our resources to provide the best services to you, our users. We’re excited to announce a change to our Java client library that will help improve your experience while using it. We will be rewriting our Java client library with Kotlin, a precise and modern coding language that will help improve the usability of our client libraries.
Kotlin provides benefits when writing and maintaining libraries, especially Java libraries. It’s a concise language with advanced features that can peacefully coexist with existing Java code in the same project. The extensive introductory tutorials and documentation Kotlin provides lower its barrier to entry for new developers, which is especially important when onboarding new contributors who may not be familiar with Kotlin or Java. Kotlin’s conciseness allows for ease of reading and improved maintainability, both important points for us! It also has broad support. While researching improvements to our SDK, we realized many of our existing dependencies, such as OkHttp, were already migrated or migrating to Kotlin. It’s also the language of choice for Android, which provides an established community to learn from for both new developers and developers inexperienced in Kotlin.
Kotlin provides additional null-safety that isn’t present out of the box in Java — you can know at compile time if you’re likely to run into a NullPointerException, the exception all Java users have come to dread. Most importantly, Kotlin code runs on the JVM, and even better, it can target Java 8. This lets existing consumers who are on Java 8 continue to use our SDK without needing to run Kotlin themselves and without us needing to use Java 8. This version of the JDK was released in March of 2014, so our switch to Kotlin allows us to use new advancements of the last (almost) decade without sacrificing compatibility for enterprise Java users.
While Kotlin is an object-oriented language like Java, it also supports — and encourages — many of the principles of Functional Programming. Of course, this is technically possible with Java as well, but it isn’t as much of a focus as it is in Kotlin
Swinging back to conciseness — Kotlin allows you to do away with a lot of the boilerplate code that has become standard in Java. Instead of creating getters, setters, implementing toString, etc., you simply create a data class in Kotlin, and all of those are generated for you. Cutting down on repetitive boilerplate code can speed up development and also reduce errors that may be introduced.
In summary, implementing Kotlin will help our SDK to become more usable, maintainable, and safe without sacrificing compatibility. The Kotlin rewrite will be available on November 1, 2021. Want to know more? Check out Kotlin’s website for more information on the language. Happy coding!