4 ms·
This times 1000. I have been using Scala for the past 3 months in a play framework app that serves json. Today I had to write some quick Java for an Android cli
by jaxytee 13y ago
This times 1000. I have been using Scala for the past 3 months in a play framework app that serves json. Today I had to write some quick Java for an Android client, and was quickly reminded how much freedom Scala's expressiveness gives you vs Java old cruft.
I mistakenly wrote a Java anonymous inner class that called a closed over variable from the outer scope like one would do with Scala closures. Of course the Java compiler threw an error because I didn't mark the variable as final.
When programing in Scala, one never has to deal with such low level rigidness. It just let's you get shit done.
- saryant 13y agoWell, be careful with those closures. Scala's compiler won't (yet) throw an error if you close over a variable from the outer scope while operating on a Future. The Scala team does have a plan to fix this though. Of course, if you aren't operating asynchronously or you're only closing over immutable values it doesn't matter anyways.