Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Overuse of 'auto' Date: Mon, 12 Dec 2022 16:00:02 -0800 Organization: None to speak of Lines: 26 Message-ID: <87k02wtbp9.fsf@nosuchdomain.example.com> References: <69e27519-337d-4891-9af3-0cccced7b6abn@googlegroups.com> <87tu2479qc.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="3ff48156ba03619b1b817f52b89d4424"; logging-data="2454452"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hW9yx6DwO1LaxtE7miG2u" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:cryiu+ez6mpSXqy/VbZ9R3G0L08= sha1:GscGaAHqG4KUqd2zKrqrcthMSf0= Xref: csiph.com comp.lang.c++:87839 scott@slp53.sl.home (Scott Lurndal) writes: > Ike Naar writes: >>On 2022-12-12, Scott Lurndal wrote: >>> long seed = random(); is perfectly readable and self documenting. >> >>The word choice is a bit unconventional. >>A seed is most often used as an initial input to >>a random number generator, not as the result of it. > > It's common to seed a PRNG with a random number. Preferably > a true random number. If you can get a "true random number", you don't need a PRNG (unless your source of true random numbers is slow or otherwise resource-intensive). But it's rare to be able to get true random numbers in the first place. > It wasn't uncommon in the early days of unix games to seed > the PRNG with the current time in seconds since the Epoch. Which is hardly random. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */