16
Found out that most coding tutorials are actually wrong about loops
I was stuck on a beginner Python project last weekend, trying to understand why my for loop kept breaking. After hours of frustration, I stumbled on a Reddit post where a guy pointed out that 90% of YouTube tutorials skip explaining how the range() function really works. He showed a stat from Stack Overflow's 2024 survey where 45% of new coders said loops were their biggest hurdle. I tried his simple explanation with pen and paper, writing out each step, and it finally clicked. Has anyone else hit a wall with loops because tutorials just assume you already get the basics?
2 comments
Log in to join the discussion
Log In2 Comments
abby_cooper6d ago
Hmm, I actually see it a bit differently... range() is pretty straightforward once you realize it's just counting up from the start number to the stop number, and the stop number never gets included. Most tutorials I've watched do explain that, but people get tripped up because they're trying to memorize instead of drawing it out like you did. The bigger issue might be that loops introduce the idea of tracking state step by step, which is a totally new way of thinking for most beginners... pen and paper solves that regardless of the tutorial.
5
danielr996d ago
range() tripped me up until I noticed it behaves like those little numbered tabs at the bottom of a checkout form.
4