I agree, kids are pretty good at isolating something they understand from the rest and just stay focus at what makes sense. If there's a piece of code that makes sense and they wrapped their heads around it doesn't matter if the rest is gibberish.
I think that's a really good point and it's key in adult learning as well. So many times we go through tons of boring theory first until we're drained of our mental energy and by the time we get to the fun part we couldn't care less. I love courses where you do stuff right away and they tell you, "don't worry about this other stuff for now, we'll get to that soon"