3 ms·
Now you're restricting yourself to a subset of the language. There's nothing stopping someone from adding a mutable member to your "immutable" type later. It's
by maleldil 2y ago
Now you're restricting yourself to a subset of the language. There's nothing stopping someone from adding a mutable member to your "immutable" type later.
It's much better to have immutable bindings/references so that nothing that mutates the object can be done through them. Rust does it very well, for example. Even C++ has a good version of this.
- ashishb 2y ago> It's much better to have immutable bindings/references so that nothing that mutates the object can be done through them. Rust does it very well, for example. Even C++ has a good version of this. Yes, that might be superior but even Java is doing better than Go here.