Earlier quoted context omitted.
Discoverability via autocomplete is much higher in the second one. Extension methods probably seem really strange to anyone coming from a FP background (myself included), but in practice they've ended up being pretty useful when paired with Intellij.
I don't like this because it forces you to use the tool, and even if you do I've seen so many times when IDE breaks down and won't autocomplete, navigates to compiled binary definition on a same solution project reference, fails to find extension methods so you need to Google which namespace to bring in to get it (which isn't always as simple as class.method search, especially when reading code example snippets), etc…
Android KTX: Kotlin Development for Android
41–50 of 75 posts
Re: Android KTX: Kotlin Development for Android
#42We've already seen something similar before: when Apple "modernized" many of the their Cocoa Touch APIs to work better with Swift.
I thought that was purely just Swift's own translation layer to make Objective C APIs more Swift-y, not an API change.
Re: Android KTX: Kotlin Development for Android
#43Earlier quoted context omitted.
Doesn't it get a bit overwhelming to get a huge list of choices with autocomplete? I've never done any serious work with Java or Kotlin, so I'm genuinely curious. As long as you have good docs, I find discoverability is rarely an issue. One of the first things I do when picking up a language is look through its built-in constructs, to familiarize myself with the available options.
Hmm, have you used any of the Java-based autocompletion systems? - IntellJ / Android Studio autocompletion system is context aware and will only list relevant methods (which means that the list is rather short and useful for the context). Which is a stark contrast to many ctags-like autocompletion systems, which will just dump all the symbols on you and aren't very useful in my experience. Using autocompletion means…
At some point I read through the Kotlin docs and found it interesting, but didn't have any projects in mind for it. I might try my hand again along with IntelliJ / Android Studio.
I've happily used other JetBrain products such as RubyMine and WebStorm.
Re: Android KTX: Kotlin Development for Android
#44As an alternative to learning Kotlin on Android, you can spend the time learning flutter. Then you get concise code which works on Android and IOS now and on other platforms in the future - including desktops.
I found all the "new" calls rather clunky, does Flutter has something like hyperscript-helpers or JSX?
Re: Android KTX: Kotlin Development for Android
#45> You may notice that Android KTX uses package names that begin with androidx. This is a new package name prefix that we will be using in future versions of Android Support Library. We hope the division between android.* and androidx.* makes it more obvious which APIs are bundled with the platform, and which are static libraries for app developers that work across different versions of Android. Ugh, okay. It's going…
Re: Android KTX: Kotlin Development for Android
#46Earlier quoted context omitted.
I found all the "new" calls rather clunky, does Flutter has something like hyperscript-helpers or JSX?
There's a discussion on github about jsx-alike syntax on Flutter ( https://github.com/flutter/flutter/issues/11609 ), and "new" keyword will be optional in Dart 2.0.
Re: Android KTX: Kotlin Development for Android
#47Earlier quoted context omitted.
you really wont be, it's like a couple of weeks and you'll be up and running in kotlin.
I don't mind Kotlin, but I don't want to get a big middle finger from Google for choosing to remain with Java for this project I already started in Java.
You won't get the kotlin syntax sugar, of course, but you're not going to be missing any features, either.
Re: Android KTX: Kotlin Development for Android
#48Not to be confused with Kotlin Android Extensions, which although handy is really just a convenient way to reference views in XML. https://kotlinlang.org/docs/tutorials/android-plugin.html
Re: Android KTX: Kotlin Development for Android
#49As an alternative to learning Kotlin on Android, you can spend the time learning flutter. Then you get concise code which works on Android and IOS now and on other platforms in the future - including desktops.
And it's made by Google, unsurprinsingly. A big plus for Kotlin is that being a jetbrains project, it has top of the line intellij tooling support right at release date.
Re: Android KTX: Kotlin Development for Android
#50Not to be confused with Kotlin Android Extensions, which although handy is really just a convenient way to reference views in XML. https://kotlinlang.org/docs/tutorials/android-plugin.html
Android Data Binding does something very similar to Kotlin Android Extensions, which is why it also perplexes me to see experienced devs bind a model to a view and then call findViewById() to alter it. I'll see calls to binding.getRoot().findViewById(), which is crazy redundant.