Re:Misconceptions about loops in C
by gabrielhidasy on Thursday June 27, 2024 @05:52PM
(#40815561)
While the formal concept of applying a function that calls itself may be more familiar to someone trained in classic mathematics, everyone is somewhat familiar with while loops, from basic life things like 'while hungry, eat' or 'salt to taste -> while (not_salty_enough()): add_salt()'
[ Parent
| on HN ]
I've successfully explained a while loop to many a child, and adult, with no experience in programming, within about 5 minutes.
I'm absolutely sure the people who think tail recursion is any way similar, in complexity, to a while loop have never attempted to teach someone how to program.
Re:Misconceptions about loops in C
by zelphirkalt on Friday June 28, 2024 @03:36AM
(#40818536)
add salt; not salty enough?; do same again!
The explanation is just as simple translatable, even saving one the words like "while" or "until".