Hacker News new | ask | show | jobs
by NotATroll 2453 days 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.

1 comments

The newbie just needs to try to use that code in any webapp. It will break. The answer is bad and needs to be downvoted.