3 ms·
Do mutable things inside your function. Have an immutable public interface. Also, split state so that it's not shared mutably among threads, and share immutable
by nine_k 3y ago
Do mutable things inside your function. Have an immutable public interface.
Also, split state so that it's not shared mutably among threads, and share immutable views when you need other threads to see it.
There are more ways to not expose mutation.