7
My kid asked me what a 'for loop' was while I was making breakfast
I was trying to explain it with the toaster, saying it's like telling the toaster 'for each piece of bread, push the lever down'. They just looked at me and said, 'But dad, the toaster does all the pieces at once.' It made me realize I was overcomplicating the basic idea for a total beginner. Has anyone found a better, simple way to explain loops to someone with zero tech background?
3 comments
Log in to join the discussion
Log In3 Comments
lunakim1mo ago
Yeah, that toaster example is actually perfect for showing the DIFFERENCE between a for loop and doing things all at once. You just accidentally taught parallel processing instead.
2
patricialee24d agoMost Upvoted
Hmm not sure I agree, batch processing can still use a for loop under the hood.
5
ruby4501mo ago
Spot what lunakim said about parallel processing, that's a really sharp point. Your kid basically called out batch processing versus doing things one by one, which is the core difference. Maybe use making a sandwich instead, where you have to repeat the same steps for each one.
2