3 ms·
But it's not at all unreasonable to think some newbie may come along, copy & paste that solution, and then call Shuffle from multiple threads. Thread safety is
by NotATroll 7y ago
But it's not at all unreasonable to think some newbie may come along, copy & paste that solution, and then call Shuffle from multiple threads.
Thread safety is something that needs to be touched on constantly, and it's smart to write your code such that it would be thread safe. Because otherwise, it just looks like a normal function call. And it could take someone ages to figure out why everything is breaking if they were to actually use that example.
- stickfigure 7y agoThe newbie just needs to try to use that code in any webapp. It will break. The answer is bad and needs to be downvoted.