4 ms·
Yeah, parts of Scala have always struck me as the most beautiful language ever, but if you dig a bit deeper, it turns into one of the most horrifying languages
by mcv 8y ago
Yeah, parts of Scala have always struck me as the most beautiful language ever, but if you dig a bit deeper, it turns into one of the most horrifying languages ever. I think the future of the JVM looks more like Kotlin than like Scale or Groovy.
- rgoulter 8y agoThere's a lot of stuff which is fine about Scala, but I still like this presentation: https://nurkiewicz.github.io/talks/2014/scalar/#/ https://nurkiewicz.github.io/talks/2014/scalar/#/ In particular, this slide is my favourite: https://nurkiewicz.github.io/talks/2014/scalar/#/22 https://nurkiewicz.github.io/talks/2014/scalar/#/22 // One of these doesn't compile seq foreach println seq.foreach{println} seq.foreach(println) seq.foreach{println(_)} seq.foreach(println(_)) seq.foreach(x => println(x)) seq.foreach(x: Int => println(x)) seq foreach{x: Int => println(x)} seq.foreach{x: Int => println(x)} seq foreach{case x => println(x)} seq.foreach{case x => println(x)} seq foreach{case x: Int => println(x)} seq.foreach{case x: Int => println(x)}
- mcv 8y agoOnly one? If there's any justice in the world, it's the only one without any brackets. I fear it's one of the many without a dot, though.
- rgoulter 8y agoThis all depends which syntactic conventions you're used to. "a + b" is more readable than "a.+(b)", and so that's what scala allows. I think it's a neat way of allowing operator overloading. "iterable.foreach { ... }" is also readable for a callback. FWIW, the one which doesn't compile is (apparently) "seq.foreach(x: Int => println(x))". https://scastie.scala-lang.org/krtG0VwgTmCNwIxATYFAbg https://scastie.scala-lang.org/krtG0VwgTmCNwIxATYFAbg
- zmmmmm 8y ago> I think the future of the JVM looks more like Kotlin than like Scale or Groovy. Seems like an odd thing to say because Kotlin looks so much like Groovy. I'm curious what you are thinking of that distinguishes it in terms of direction?