"Learning to code" is actually a by-product of this endeavour NOT the main focus.
It's about Problem solving skills.
Give a group of kids a Problem to solve and the tools required to find a solution.
This can be in any medium you like, for example give them a pile of wood, rope and woodworking tools and tell them to make a working trebuchet.
It's just that it's cheaper and safer to use electronics and coding rather than Middle-age siege weapons!