philipLutz
Re:GitHub reveals how software engineers are purging federal databases
on Tuesday February 04, 2025 @02:44PM (#42937552)
Find and replace "Equity" with "1337"?
Re:My favorite prime number generator
on Wednesday August 23, 2023 @12:10PM (#37238226)
"I can't try to rewrite it in C++ or Rust for now, due to the lack of generator support; the yield statement is what makes this code so nice and elegant, and alternative idioms are much less convenient."
Re:My favorite prime number generator
on Wednesday August 23, 2023 @11:46AM (#37237843)
I enjoyed this, but I am a little stuck on how stuck the author is on yield. If one ends up creating a large list of prime numbers with this generator, why not just return a large list of prime numbers? The author clearly notes how optimizing Python code is "odd" when you can more easily switch languages, but languages like C/C++/Rust would not have pretty code because it does not have yield. It is obvious that returning an array of prime numbers is what one would do in C/C++/Rust.
I understand that not using yield would mean it is not strictly a "generator", but the spirit of this problem is generating the sequence of primes (unless I am missing something).
Re:Monoliths Are Not Dinosaurs
on Friday May 05, 2023 @09:05PM (#35836960)
there is no silver bullet