3 ms·
Just curious -- and be honest -- the snippet at the end they ask you to decipher (and they say "Most programmers find it hard to understand unless they have a f
by encoderer 15y ago
Just curious -- and be honest -- the snippet at the end they ask you to decipher (and they say "Most programmers find it hard to understand unless they have a functional programming background, so don't feel bad if you don't get it immediately") did you have trouble with it?
For me, I thought I had the answer after maybe 30 seconds of reading it, but decided to "check my work" by walking through it again, and only then, a moment later, did I realize what it was actually doing with that recursive call.
I'm just curious about their "most programmers without a functional background" remark. So: did ya get it?
- pingswept 15y agoYes, but it would have been significantly more baffling if the word "sieve" didn't hint at its behavior. Still, I'm not sure that a functional background would have helped, or maybe my background is more functional than I think. I know some Python, and I read a few articles about functional programming a couple of years ago, but I don't think I could give you a clear definition of what functional programming is.
- riffraff 15y agoI don't have a big experience with functional languages, but I got it quickly too. As written in the page, the name is too much of a giveaway.
- romey 15y agoThe name "sieve" gave it away for me before I'd even looked at the code, but I decided to make sure I was right. Then i looked at it and my mind was kind of blown but how neat and concise it was. This definitely makes me want to take a look at functional programming (just ordered "The Little Schemer")