[Haskell-cafe] capture of idioms and patterns
Vo Minh Thu
noteed at gmail.com
Fri Sep 24 18:24:03 EDT 2010
2010/9/24 Albert Y. C. Lai <trebla at vex.net>:
> On 10-09-23 04:57 PM, Andrew Coppin wrote:
>> If you think that sounds silly, ask some random person (not a computer
>> programmer, just some random human) how find the sum of a list of
> My reply: to sum 10 numbers, sum 9 numbers, then account for the 10th. More
> Ask some random person how to find page 314 in a book. No one replies "check
> the 1st page, check the 2nd page, check the 3rd page...". In fact, no one
> replies in words. Almost everyone shows you how to cut to the middle or the
> estimated weighted middle (if the book seems to have 1000 pages, they cut
> near the one-third point), then say "oh, before this" or "oh, after this",
> repeat. Almost everyone divides and conquers. Almost everyone recurses.
> I am not a computer programmer.
> (I know that someone is bound to think, "when confronted with the problem of
> summing numbers, some people think, 'I know, I will divide and conquer'. Now
> they have two problems of summing numbers.")
A computer scientist knows how to count the stars in the sky: simply
count half of them then multiply by two. -- or something like that.
More information about the Haskell-Cafe