Hi, Here are several things that come to mind:
- You will only save if none of the dependencies (or the standard library itself) uses the avoided Scala class. - Some Scala APIs are so much more convenient, that their usage is well justified. A good example is BigInteger, which (unlike its Java counterpart) supports symbolic operators, i.e. +, -, *, ... - Finally, AFAIK the heaviest part of the standard library (in terms of both size and class/method count) lies in the collections. However, this is one of the most appealing parts as well! So, while you may save on scala.util.random, the effect will not be all that visible in the grand scheme of things. That said, on several occasions I have felt that a particular subset of the standard library is better left untouched (as in “not utilized”). This includes scala-xml (which is a separate jar since 2.11) and parallel collections (which seem to pull in quite a lot of code). Hope that helps, Nick On Wednesday, May 28, 2014 12:54:12 AM UTC+1, Daniel Bauer wrote: > > Hey, > > Im wondering if there are any pros/cons of using a native java class over > a scala class if they both fill the same purpose. > > For example, lets say you want a random number generator. There is > java.util.random and scala.util.random which seem to be the same > implementation for me. Should I use the java-version for android > development to reduce the number of used scala functions (and by this maybe > reduce the apk/library size after proguard)? > > regards, > danijoo > > > -- You received this message because you are subscribed to the Google Groups "scala-on-android" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
