News for hackers. Stuff that matters.
Re:Gnirehtet rewritten in Rust by moomin on Sunday September 24, 2017 @05:37PM (#15326615)
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.

Re:Gnirehtet rewritten in Rust by solidsnack9000 on Sunday September 24, 2017 @05:59PM (#15326706)
> ...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.