Good day madams/sirs. This is the first time I am ...
# announcements
d
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
ferranis: Unicycles are fun tho. Java not so much.
d
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
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
@Daniel Java8 is coming to Android tho...
😆 1
d
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
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
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
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