3 ms·
> If you're okay with using old Java versions, it's not much of a stretch to say you'll be okay with old Scala versions. No, because Scala doesn't offer forwar
by lmm 10y ago
> If you're okay with using old Java versions, it's not much of a stretch to say you'll be okay with old Scala versions.
No, because Scala doesn't offer forward binary or source compatibility. Maintainers of widely-used Java libraries can write and build for Java 6 and be confident their libraries will be usable by everyone (on Android and off). Maintainers of widely-used Scala libraries have no such option (for now they can write their code using the subset that works in Scala 2.11 and 2.12 and cross-build, but there's no guarantee that such a subset will be maintained in 2.13 and beyond).
- paulddraper 10y ago> there's no guarantee that such a subset will be maintained There's no guarantee about Java either. This class compiles with Java 7, but not with Java 8: class SampleClass { static class Baz<T> { public static java.util.List<Baz<Object>> sampleMethod(Baz<Object> param) { return null; } } private static void bar(Baz arg) { Baz element = Baz.sampleMethod(arg).get(0); } } Like Java or any other good software, Scala will try to maintain backwards compatibility (particularly source compatibility).
- lmm 10y ago> There's no guarantee about Java either. This class compiles with Java 7, but not with Java 8: Ok, but you can compile it with the newer compiler by passing -source 1.7, right? And you can call into it from 1.8 code?
- paulddraper 10y agoYes, binary compatibility is maintained in this case.