Comment

Comment by yareally

On Android, Scala gets compiled to dex bytecode just the same as Java. Scala has slightly more overhead though from making lots of small objects, but the tradeoff is worth it if you prefer not using Java.

I stick to using Java Collections (and the special ones Android provides[1]) most of the time to avoid excess overhead, but it still results in much more concise code than what I would write in Java. One of most compelling reasons to use Scala though is it's much easier to deal with asynchronous processing (via actors, futures, async/await[2]) than the messes you end up with using AsyncTask + callbacks with Java.

[1] http://developer.android.com/reference/android/support/v4/ut...

[2] http://docs.scala-lang.org/sips/pending/async.html

parent yareally 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton