Post AbSChih46asSnpS7yi by mark@waterford.international
 (DIR) More posts by mark@waterford.international
 (DIR) Post #AbSChih46asSnpS7yi by mark@waterford.international
       2023-11-03T21:48:09Z
       
       0 likes, 0 repeats
       
       Big fan of #scala as a language, what with its pattern matching and partial functions and general coolness, but every code snippet I see in the wild is just ugly junk. The world is just not cool enough for it. (And the bog standard stuff looks better in bog standard languages.)#software #code #languages
       
 (DIR) Post #AbSCiO862zrTJXPnIu by alexelcu@social.alexn.org
       2023-11-04T06:04:42Z
       
       0 likes, 0 repeats
       
       @mark Beauty is in the eye of the beholder.Scala code is some of the most beautiful code that I read. And it's useful to see what the alternatives look like before judging beauty.For example, I struggled yesterday to translate this piece to Kotlin, a piece of code that in Scala looks very straightforward to me:https://gist.github.com/alexandru/3282ed5e92aa121083fc4c38526d5a66
       
 (DIR) Post #AbSO9TLdqtk2oUrsVk by mark@waterford.international
       2023-11-04T08:12:57Z
       
       0 likes, 0 repeats
       
       @alexelcu This sort of snippet is what I think about when I think of beautiful scala code. Recursion, pattern matching, etc. My point is that if people are mostly writing something like an MVC application or a “business application” with services, facades and all that, you don’t see much beauty. For example, there is nothing pretty about the snippets on this Akka intro:  https://www.baeldung.com/scala/akka-httpProbably nicer in kotlin or java.
       
 (DIR) Post #AbTJjkYl23gm0SRSVc by alexelcu@social.alexn.org
       2023-11-04T18:58:14Z
       
       0 likes, 0 repeats
       
       @mark Akka looks worse in Java. I think the problem is with Akka, though. Great project, but it has a lot of complexity.I love some of the Kotlin APIs that I'm seeing, BTW. Jetpack Compose is really nice, coroutines too. But Scala shines for static FP, IME, for real-world use. Its expressive power requires some restraint and good taste, but I wouldn't have it any other way and I'm basically rooting for Java and Kotlin to become more like Scala 😃