Live data from Hacker News

Android KTX: Kotlin Development for Android

android-developers.googleblog.com

11–20 of 75 posts

Re: Android KTX: Kotlin Development for Android

#11

We've already seen something similar before: when Apple "modernized" many of the their Cocoa Touch APIs to work better with Swift.

What does "already seeing this" have to do with any meaningful input on the subject?

I was providing a parallel from my experience, which I thought might foster discussion on how such an API improvement might proceed based on historical anecdotes. Was this not a welcome addition?

Re: Android KTX: Kotlin Development for Android

#12
post #7

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.

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.

Typing a couple characters is generally enough to cut out most of the noise, so long as you know vaguely what you're looking for and the methods are sensibly named.

I don't think it's the built-in constructs which are hard to find. In JVM-land, it's sifting through often verbose library interfaces that makes discoverability a huge win. Looking in Javadoc for that single function to convert from Type A to Type B properly can be a real pain.

Re: Android KTX: Kotlin Development for Android

#13
post #2

Still working in Java on Android. Have a feeling that I will be left behind soon.

Same here. On my my most recent project the client requested we use Java, since after they take over they can use devs with Java knowledge.

It will take a week or two to convert experienced Java devs to Kotlin.

Re: Android KTX: Kotlin Development for Android

#15

Earlier quoted context omitted.

What does "already seeing this" have to do with any meaningful input on the subject?

I was providing a parallel from my experience, which I thought might foster discussion on how such an API improvement might proceed based on historical anecdotes. Was this not a welcome addition?

i think people are interested in the lessons learned in the past. are you sceptical or hopeful? how did apple's stab at this work out in the past? is it fundamentally flawed or deeply overdue.

Re: Android KTX: Kotlin Development for Android

#16
> 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 to be a blast refactoring all my existing code and custom tools to reference this new package.

Re: Android KTX: Kotlin Development for Android

#17

We've already seen something similar before: when Apple "modernized" many of the their Cocoa Touch APIs to work better with Swift.

Can you elaborate on what we have seen? Modernization in quotes suggests that Apple wasn’t successful.

I put modernization in quotes because in most cases it was really a shim placed ontop of the existing Objective-C API that changed some names or parameter types; so, in this case it wasn't quite as extensive as a Java->Kotlin transition would be since Objective-C already supports many "modern" features such as closures.

Re: Android KTX: Kotlin Development for Android

#18

Earlier quoted context omitted.

I was providing a parallel from my experience, which I thought might foster discussion on how such an API improvement might proceed based on historical anecdotes. Was this not a welcome addition?

i think people are interested in the lessons learned in the past. are you sceptical or hopeful? how did apple's stab at this work out in the past? is it fundamentally flawed or deeply overdue.

I think Apple did a pretty good job in most cases when getting their code to work well in Swift. I'm hopeful that this will also be the case with Android, but the hitch is that a lot will have to change. Swift's closures, extensions, etc. already had Objective-C counterparts which were not difficult to translate; but Java, on the other hand, doesn't provide many of the features that Kotlin does (hence the drastic reduction of boilerplate we can see in the blog post).

Re: Android KTX: Kotlin Development for Android

#19

Why is it that these large web companies can put out such sophisticated tools, and yet can't make a functional web page? Literally cannot see the content you are trying to show me. https://imgur.com/a/lXY8J And no, there's no scrolling or zooming allowed. Seriously, let's stop the focus on web framework du jour and actually make web sites that work, please.

There's more chance for human error at a large company.

Looks like it could be fixed by adding a CSS "white-space: pre-wrap" to the

 elements they're using to display this code.
Post reply on HN