2 ms·
This is true, but Scala 3 solves this with enums. And with the new optional brace syntax, Scala is starting to look more like OCaml every day. In Scala 3: e
by smabie 6y ago
This is true, but Scala 3 solves this with enums. And with the new optional brace syntax, Scala is starting to look more like OCaml every day. In Scala 3:
enum PaymentMethod
case Cash
case CreditCard(name: String, number: String, expiry: String)
Seq(Cash, CreditCard("Bob", "1111111111111111", "10/21"))
- yawaramin 6y agoThat's unfortunately another one of Scala's cons, there will be a large breaking change in a few years and the ecosystem will be split again.
- pjmlp 6y agoJava is slowly getting good enough for those of us that have to deal with mob development while wanting to enjoy a little bit of FP programming in the process, if the optional brace syntax goes through, that might that be the final straw for those that haven't yet moved back to Java or started to find new loves like Kotlin.