https://kotlinlang.org logo
#announcements
Title
# announcements
d

Daniel

05/01/2017, 12:14 PM
Good day madams/sirs. This is the first time I am in this chat and I just wanted so say a huge thanks to the makers and contributors of kotlin! Its such a wonderful language and for a android developer Java to Kotlin is like going from a unicycle to a spaceship! So much less code and less hassle!
K 7
✌️ 2
m

mg6maciej

05/01/2017, 12:15 PM
ferranis: Unicycles are fun tho. Java not so much.
d

Daniel

05/01/2017, 12:18 PM
Especially the old timy java you are forced with at android... First time i used extension functions especially on collections it was like science fiction...
c

Czar

05/01/2017, 12:29 PM
Yeah, extensions are like that 🙂 I find code much cleaner, when I have to implement
DomainObject.someModuleSpecificMethod()
and instead of creating a child class I'm just implementing an extension method visible in just that module.
m

mg6maciej

05/01/2017, 12:30 PM
@Daniel Java8 is coming to Android tho...
😆 1
d

Daniel

05/01/2017, 12:36 PM
Jep, that sure helps. You could use it already with the jack build-chain - but not without one or two issues. 😕 On top of that the really nice features (stream api) are only avaiable when you target a very recent android version (and lose a lot of users doing so)
And on the topic of extensions - you can make the android api much more clean and readable with it. Thinks like view.visibility = VISIBLE always bother me. Why not just View.show() (for example)
We'll be able to use Streams API in 2-3 years, so that's better than nothing.
d

Daniel

05/01/2017, 12:48 PM
Good one on git and its funny, nearly the same as the ViewExtensions in my project. Proof that the api is somewhat lacking. Also a nice bit i found useful: fun View.assignWidth(width: Int) = apply { layoutParams.width = width } Falls in the same category as this ugly visibility = X
m

mg6maciej

05/01/2017, 12:50 PM
Can't please everybody with API. Extensions help, but I don't think should be put in Android API or even something like
com.android.support:support-kotlin
.
d

Daniel

05/01/2017, 12:52 PM
Fully agree on that. It shouln't be includes because 'we' like it so. There may and for sure are other opinions. That's the beautiful think with kotlin, we can easily extend the api to our liking the the extensions
2 Views