Learning Kotlin: todo

Submitted by Robert MacLean on Fri, 08/24/2018 - 09:00
**More Information** * This is the 24th post in a multipart series. If you want to read more, see our [series index](/learning-kotlin-introduction) This post will be a shorter than normal one, as we are looking at a small feature that is easy to explain but can have major impacts to your code base and that is the [`todo` function](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-t-o-d-o.html). To use it, you simply call it and optionally pass in a string which gives a reason why that code is not done. For example: fun main(args:Array<String>) {   todo("Haven't started") } This will throw a [`NotImplementedError`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-not-implemented-error/index.html) when it is encountered. What I really like about this is that we are being explicit about the intent. In addition it makes it really easy to find in your IDE of choice.