I don't know about the other languages mentioned though.
I prepare curriculum for Grades 4 and 5 on Programming using Scratch and Flowcharts and teach kids to create blocks whenever they see that functionalities are getting repeated.
Kids tend to learn a little differently compared to adults. Adults tend to want to know the 'big picture' before they begin and tend to have different preconceptions based on what they've learnt earlier. Kids' learning is much more playful, motivated more by inquisitiveness and curiosity. They don't have the urge to prove anything to anyone, including themselves.
At those grades, their brains are very flexible and they can think of strange combinations and the ultimate goal of having a program solve a problem is not the aim. Even after many years, I find it hard to let go of trying to guide kids towards a goal, rather than keeping my mind open to new things that they are able to see just because they're not motivated the same way we as adults are.