Curious, is anyone inside of Google using Kotlin for their Android apps, or is this all for third party developers?
I heard the Android data binding compiler was written in Kotlin. At KotlinConf, they announced that Google had dropped Java altogether for writing Lint rules because of Kotlin's much greater capabilities for handling deprecated code and IDE quick fixes.
Android KTX: Kotlin Development for Android
71–75 of 75 posts
Re: Android KTX: Kotlin Development for Android
#72Earlier quoted context omitted.
I heard the Android data binding compiler was written in Kotlin. At KotlinConf, they announced that Google had dropped Java altogether for writing Lint rules because of Kotlin's much greater capabilities for handling deprecated code and IDE quick fixes.
Wasn't the linter thing just about moving the lint rules (for checking proper Android API usage) to a language-independent format so that they could be shared by Java and Kotlin? Previously they only worked for Java code.
https://www.youtube.com/watch?v=p8yX5-lPS6o&list=PLQ176FUIyI...
Re: Android KTX: Kotlin Development for Android
#73Earlier quoted context omitted.
Not true, it's very misleading - makes you believe the method is defined inside class body. Also with functions you know they can't access private members, with extension methods you confuse them with real methods and have to think they can. It's only the same thing if you know about it and without a tool you can't know, even with tool it takes some inspection.
Extension functions are syntax sugar for static methods that receive the class instance as this. They do not access private members. Also, you need to specifically import the namespace of the extension function in order to use it, making it very clear to the reader of what is going on. It is not some hidden IDE magic, it's built into the core language.
I said it was misleading syntax sugar because it implies that static functions defined in any namespace (extension methods) are the same as methods - which have access to internal members and are defined within class hierarchy.
If you know something is an extension method then you know it's just syntax sugar, but you can't determine that just by looking at the code.
Re: Android KTX: Kotlin Development for Android
#74Earlier quoted context omitted.
Not true, it's very misleading - makes you believe the method is defined inside class body. Also with functions you know they can't access private members, with extension methods you confuse them with real methods and have to think they can. It's only the same thing if you know about it and without a tool you can't know, even with tool it takes some inspection.
I suspect the design of a class, if I have to worry about whether a method I'm calling is able to access private members or not.