|
|
|
|
|
by ufo
3791 days ago
|
|
Did you read the "But Seriously" section of that page? It explains that how the different examples actually highlight some advanced functional programming techniques. In practice, there are some of the examples that are more important than the others: - The "accumulating" version might use less stack-space than the naive recursion so its a very important technique to learn. - The foldl version is a more structured version of the accumulating version, kind of like how a for loop if is more structured than a goto. - The memoizing (aka caching) version is useful if your funcion is very expensive to compute. - And the "tenured professor" obviously makes the best use of the existing syntactic suger :) The rest of the entries are a bit more overkill for a factorial program. |
|