4 ms·
It's interesting, but overstated. It's more a description of how some Java patterns don't translate. For instance, the first example "encapsulation" demonstrate
by moomin 9y ago
It's interesting, but overstated. It's more a description of how some Java patterns don't translate. For instance, the first example "encapsulation" demonstrates exactly no encapsulation.
In general terms although sometimes you need to do things like this, shared mutable state is something you should be avoiding in any language and you should thank Rust for making it harder on you.
- solidsnack9000 9y ago> ...the first example "encapsulation" demonstrates exactly no encapsulation. It demonstrates a kind of getter, but a weird one since it returns a mutable field. These are not the most encapsulated thing.