3 ms·
> As it was designed for complete interoperability with Java, Android devs can migrate piecemeal. You can use the same libraries, the same build system, the sam
by eeperson 9y ago
> As it was designed for complete interoperability with Java, Android devs can migrate piecemeal. You can use the same libraries, the same build system, the same IDE.
This is all true for Scala as well.
- pjmlp 9y agoNot really, it appears to require InteliJ and cannot work with the modified version that is actually Android Studio. It also doesn't integrate with the language aware tooling from Android Studio or the Gradle versions being used on Android Studio. At least this was the situation last year.
- eeperson 9y agoReally? I haven't tried setting that up but here is an example from 3 years ago of some one successfully setting up this exact combination [1]. Have things gotten worse sense then? [1] https://groups.google.com/forum/#!topic/scala-on-android/0y1VQ8t4Ojg https://groups.google.com/forum/#!topic/scala-on-android/0y1...
- cryptos 9y agoNo, it's not. Scala can call Java easily, but not the other way around. Calling Java from Scala is awkward at best (in many cases) and sometimes impossible. Scala was never engineered with a smooth Java/Scala mixed mode in mind. The opposite is true: In Scala almost everything from Java gets reinvented sooner or later.
- eeperson 9y agoThis hasn't matched my experience. > Calling Java from Scala is awkward at best (in many cases) and sometimes impossible. Scala was never engineered with a smooth Java/Scala mixed mode in mind. I assume you meant calling Scala from Java here. With that in mind, writing an API that is easy to use from Java isn't that difficult. It is basically down to limiting the feature set you make use of in the interface and converting to Java collections. These are both pretty easy to do. Granted some Scala features are expressed in ways that are not easily used from Java. However, this just because Scala is significantly more expressive than Java. I'm not sure why you consider this to be a problem. > In Scala almost everything from Java gets reinvented sooner or later. I'm not sure what your point is with this. Scala wrappers for Java code are common but not because of issues with calling Java code. These are written because Scala can expose a much richer and much safer interface (again because Scala is much more expressive).