Some things should be left until big school
I'm not sure primary school is the right place for learning to code or learning other difficult things. At primary school in the 60s, I didn't learn any 'science' except for a single lesson in the final year (more about that below). Yet I often wondered about things in the natural world. For example, I would often wonder whether a ball bearing could be cut in half, or whether it was some indivisible thing. More perversely, I sometimes wondered what I would see if I cut my thumb off. At my first science lesson at secondary, I was told everything was made from atoms. It explained so much of what I didn't know and wondered about. And more importantly, it made sense to me. I don't think I would have appreciated that lesson as much if I'd been told at age 7 that everything was made from atoms.
The single 'science' lesson we had at primary didn't actually teach or explain anything. Rather, it let us explore some interesting things (which is heavier, water or sand, etc.) The killer thing was being asked whether water could flow uphill, and then being shown how to syphon water from one bucket to another. That sealed things for me, science was more magical than Jesus. :-)
Rather than being taught how to code, are there not better activities for primary school that would make learning to code at secondary much more understandable and rewarding?