Talk:One of n lines in a file

From Rosetta Code
Revision as of 21:18, 14 September 2011 by MikeMol (talk | contribs) (→‎implicit constraints: Numeric limits)

Inspiration

I read this and thought of RC. --Paddy3118 22:03, 7 September 2011 (UTC)

implicit constraints

I believe that this task implicitly assumes that a single line will always be small enough to be kept in memory? If so, I think that this assumption should be explicitly stated. (It sounds silly, but it can turn into a real issue.) --Rdm 20:19, 14 September 2011 (UTC)

Choosing a random item from a sequence of unknown length has its uses other than reading files. Actually since the task doesn't ask anyone to read a file anyway, shouldn't it be named something else like, er, "Choosing a random item from a sequence of unknown length"? --Ledrug 20:36, 14 September 2011 (UTC)

I don't know whether it's worth noting or not, but there will be issues relating to precision in implementations' real, non-integer numeric types and with precision in its random number generator. --Michael Mol 21:18, 14 September 2011 (UTC)