News for hackers. Stuff that matters.
Re:Programming Idioms by codernyc16 on Thursday September 26, 2019 @11:58AM (#21082241)
The example did not have threaded code so I find your nitpick unfair. The usage of random in their examples is perfectly fine.
Re:Programming Idioms by ben509 on Thursday September 26, 2019 @12:23PM (#21082553)
If the site is providing toy examples that are not useful in production, then it should state that.

If "idioms" mean code that adheres to best practices, given that C# code is frequently threaded, their examples should mitigate common threading issues.

Re:Programming Idioms by wruza on Thursday September 26, 2019 @03:37PM (#21084657)
>then it should state that.

It will be ignored. StackOverflow guys and all participants have put an enormous effort into making it at least partially trusted source of snippets, and I hope it will never be outranked by sites like this.

(to creator: sorry for this, but in a long run it only harms everyone, unless you “die” for it)

Re:Programming Idioms by marshray on Thursday September 26, 2019 @04:53PM (#21085419)
If the language runtime supports threading, in the absence of explicit documentation, code that assumes single thread access is broken.