2 ms·
it is indeed. Kotlin has gained some popularity among Android devs and is focusing on it. Still, it is hard to use all of Kotlin's features when you have to d
by on_and_off 11y ago
it is indeed. Kotlin has gained some popularity among Android devs and is focusing on it.
Still, it is hard to use all of Kotlin's features when you have to dialog with a java framework.
So eg for UI code, you might end up with quasi-java code.
I would still love to see Kotlin pushed as the platform's language or alternatively a Rust inspired language.
Another big challenge of such a move would be the back compatibility story.
- rattray 11y agoFor UI code, consider checking out anko: https://github.com/JetBrains/anko https://github.com/JetBrains/anko
- mike_hearn 11y agoCheck out Anko. It's a good demo of how to use Kotlin's features to extend native Java frameworks. For instance you can define the UI using a Kotlin DSL rather than XML.
- on_and_off 11y agoyeah, I have checked that out. As much as I dislike xml, I don't think I want to place my layouts in my code though. From what I have seen, Anko's answer to how to handle buckets is 'just do it by code'. I need to see how it works for very complex layouts. I have written several very complex UIs that I don't think would be expressed easily with Anko. Again, I should really have a try, it seems to bring some niceties that I would have to write custom ViewGroup code to do with the base framework. However my argument had more to do with the Android's API surface area than the UI in particular. How much does having to deal with a pure java API for something like Chromecast (again, insert any android API instead) hampers Kotlin code style ?