Stack of papers, flight of stairs, layers of onions, circle of life, etc. they all just harken back to what it actually is without having to define it directly.
If we're using an 80x86 processor, the function concept is more or less implemented by several facilities - you have a sequence of instructions somewhere in memory, you have a stack area (shared by everything in a given address-space, using a stack pointer in the cpu), you a call instruction that pushes the current instruction pointer to the stack as well as pushing flags and similar stuff to the stack and you have the return instruction, which does the opposite, restore instruction pointer and whatever else was pushed in the call.
Which is to say that on a raw, low level, functions don't "exist" in the fashion a programmer imagine at a higher level. That's not saying the concept is wrong but is saying that the people don't easily see functions as the natural building blocks of everything might be wrong either.
There are recursive structures in nature. Some people might respond to the neatness of recursively generated graphics. Pointing out recursion in language could be useful. Introduce a program for recursively generating random sentences and such.
Similarly when we look at a picture on a wall, we interpret the scene within using the same machinery as we interpret the real world, while also being aware that the scene is "on the stack" relative to real things like the wall. There is nothing about a picture within a picture that breaks our comprehension of what we are looking at.
I think {you know {what I'm talking about}}.
It is strange that recursion seems hard and loops seem easy to most brains.
Start with a basket of tomatoes and a bowl. If there are no tomatoes in the basket, you’re done. Otherwise: Take one tomato. Dice it. Put the output in the bowl. Recur.
How about this example as an example of recursion: Looking up a word in a dictionary (a real-life binary search).
Every shampoo bottle has recursive instructions:
Wash, rinse, repeat.
Also: Eat, work, sleep, then do it all again tomorrow.
Who are your ancestors? Your parents and all their ancestors.
Oof, shade thrown.
Personally I think it should not be used for implementation, I consider it to be a security risk. It's ok for high-level pseudocode.
> I consider it to be a security risk.
Again, non-issue if your language handles recursion properly (and in some languages like Haskell, "blowing the stack" is not a thing that happens).
[0] https://en.wikipedia.org/wiki/Tail_call#Implementation_metho...
For some, it’s practically the only way to loop.
Accomplishing tasks with recursion? That's utterly counter-intuitive imo. A given person can learn it but feels like a trick. Maybe a cool trick they're cool for having learned and maybe a weird trick someone is pushing on them.
Recursive solutions to programming problems can be great once you get the whole idea but recursion is not an easy way to start people programming. It might not be a bad way - if you're a highly committed 17 teen year old hot learn new things and willing to put in serious effort. learning LISP at MIT back when they taught is something would have like to have done. IE, Hard isn't necessarily bad. But don't expect people who want to put in minimal effort, who are terrified by just showing up to learning programming, to learn this hard way. And especially don't expect them to appreciate that you decided to teach this way.
A lot of programming geeks are in denial about the inherent conceptual difficulty of functional programming (which isn't even to say fp is bad, it has many virtues but easy for novices will never be one).
Edit: To put it in the author's terms, there's hierarchy of modalities and procedural processes are on the bottom and thus everyone can get them. Maybe 1-1 tutoring can different.