4 ms·
I'd use Scala or Rust for everything. In Java, one creates a 55 lines getter-setter class with concurrency bugs and accidental mutation risks, and maybe plus a
by KajMagnus 7y ago
I'd use Scala or Rust for everything.
In Java, one creates a 55 lines getter-setter class with concurrency bugs and accidental mutation risks, and maybe plus a 55 lines Builder too.
Whilst in Scala I create a 5 lines case class, immutable and thread safe, all that's needed.
- apta 7y agoJava is getting data classes (case classes in Scala), as well as value types.
- mckinney 7y agoData classes are nice, but they are not a general substitution for Properties, which address the greater getter/setter boilerplate concern. That said, you can use project Lombok for that pretty straightforwardly. You can also use project Manifold[1] to add useful features many of which Scala lacks: * Type-safe metaprogramming (like F# type providers) * Structural Typing * Extension methods * String interpolation * Templates * Type-safe reflection * [Un]Checked exceptions [1]: https://github.com/manifold-systems/manifold https://github.com/manifold-systems/manifold
- KajMagnus 7y agoInteresting, I didn't know, thanks for mentioning.