

Android Applications with Kotlin - hhariri
http://hadihariri.com/2013/05/21/android-applications-with-kotlin/

======
scotth
How does it perform? IIRC, startup time suffers when using Scala or Clojure on
Android. Is that the case here?

~~~
hhariri
We've not run specific tests yet for Android, but, unlike Scala, our runtime
is small and the code performs as fast as Java on most benchmarks.

~~~
scotth
Sounds promising. I'll give it a shot.

~~~
oh_really
I can only recommend that you take all the claims from JetBrains employees
about other languages with a large grain of salt.

Having watched most of their presentations, it seems to be a sad fact that
they can't seem to sell their language without spreading FUD and making
misleading claims about their “competitors” (especially about Scala it seems).

I can totally understand how frustrating it must be for the Kotlin devs that
they have still failed to produce anything which could be described as a
stable, working release, but I think the right solution for them would be to
spend less time bashing other languages and to work harder, not to badmouth
and disrespect other open-source communities, their work and their projects.

If you are interested in Scala on Android in particular, there is a whole
mailing list dedicated to it: <https://groups.google.com/forum/#!forum/scala-
on-android>

~~~
scotth
I didn't take what hhariri said as FUD -- it only confirmed what I'd heard
elsewhere.

And since I don't evaluate technologies on claims alone, trying Kotlin out
can't hurt.

~~~
oh_really
<https://news.ycombinator.com/item?id=5747657> (the similar user names seem to
be a funny coincidence, I'm not related to that person in any way)

~~~
scotth
That was certainly interesting, but it seems far from conclusive. It's an
Android beginner saying that everything seemed to work alright. Is he/she in a
good position to evaluate startup performance?

~~~
oh_really
> Is he/she in a good position to evaluate startup performance?

Even my grandma would be in a good position to evaluate startup performance.

Anyway, I was building an app back in the time of Android 2.0 to discover the
platform and I had no problems, neither with startup time nor with apk size.

That's why I get a bit concerned when people who a) build a “competing”
language and b) only seem to know Scala from reading stuff on the internet,
make misleading claims. If this had just happened once I wouldn't have said
anything, but this seems to become a pattern.

------
RyanZAG
Quick summary of Kotlin and why you'd want to use it in Android:

    
    
      Lambdas
      Fairly lightweight, probably looking at 10% overhead only
      Can ducktype existing classes. eg add "hello".reverse()
      IDE support in Jetbrains (but not in eclipse)
      Can turn 'try..finally' into library methods
      Full interop with java files in same project
      val/var types help to reduce side effects

~~~
hhariri
In addition it removes a lot of boilerplate code with things such as automatic
casting. Adds null safety.

~~~
dodyg
For me it's the function expansion syntax.

    
    
      fun main(args : Array<String>) {
        val a =  calculate(1) { x -> 10 + x } //11
        val b = calculate(2) { x -> 20 * x } //40
    
        println("a = $a, b = $b")
      }
    
      fun calculate(a : Int,  calc : (Int) -> Int) : Int{
        return calc(a)
      }

