Iteration for Factorials

cokofreedom at cokofreedom at
Tue Oct 23 10:09:06 CEST 2007

On Oct 23, 8:53 am, "Hendrik van Rooyen" <m... at> wrote:
>  "Marco Mariani" <> wrote:
> > I don't see how my answer is in any way worse than those based on
> > lambda. Maybe I'm just envious because when I was his age I couldn't
> > google for answers. He should at least be able to do that, shouldn't he?
> > But wait. That would mean understanding what a factorial is. That would
> > require a second search, or a textbook, or an understanding of
> > arithmetics before programming with or without recursion. Should we
> > blame the teachers?
> Yes.  And burn their cars to get their attention!
> Asking someone to write a factorial algorithm before he knows WTF a
> factorial "is", is either insane, or the ultimate demonstration of deliberate
> lack of cooperation and coordination between departments.
> I feel kind of strongly about this ever since, as a student, the physics people
> expected me to use mathematics that I had not been taught yet...
>  ;-)
> I shall try to refrain from commenting on the concept of introducing
> recursion into a first course in CS - I am too much tainted by my ability
> to mentally "see" the stack growth in a small processor to be qualified
> to comment.
> - Hendrik

Completely agree with this point of view. After being on the receiving
end of such problems when first introduced to Haskell and told to look
at a database written in it and work my way through it (without having
started the course on databases, locks, or any of that jargon) you
find yourself almost helpless at times.

Hard to google for something you don't know about.

Recursive calling is a fun, and yet painful, thing...

More information about the Python-list mailing list