Agreed. I don't believe programming should be taught in school until late, but the use of games to bring maths alive, to give maths a relevance, would be fantastic. I, like most people, don't work in the abstract and need a framework to a) interest me in things, and b) to make them relevant. Without that it's so much harder.
Just IMO, programming is addictively fun and can be shallow. I think the clarity of thought and concept that maths brings is far more important. The ability to plan, to focus, to organise, and more broadly to interact with others and other life skills.
Programming does not teach those, indeed it allows the production of scrappy stuff that seems to work and is great fun. I found it hugely distracting myself in the way that social media is addictive to current kids.
I'm not explaining myself well and perhaps I'm extrapolating too much from my own case, but I hope that gives you an idea of what I'm trying to say - the very thing in programming - the bringing of something to a kind of life - is the very thing that makes it valuable to hang mathematics off, is also the thing that makes it a shiny bauble that kids/younger adults love to dabble with and be distracted by.
But your experience suggests a different POV. I may well be wrong.
"The ability to plan, to focus, to organise" is exactly what you need to build programs except for the most trivial hello world ones.
Interacting with people is also often part of it. Perhaps you make something with your friends (eg we made a class website for our school class where we uploaded photo galleries of our events and had forums and chat - all pre-facebook, around 2002-03).
By contrast math is very individual and often taught quite bad without any interaction. You learn each type of calculation task you may get on the test, memorize definitions and proofs...
And it's pretty much impossible to work on a "math project" with your friends in your free time to hone those interaction skills. Perhaps if you went to a special math focused school you could talk about math with them in your free time, in most schools that's not the case, outside perhaps discussing how to solve the test questions.
On the contrary I think a lot of the maths in school could be much better taught if they were taught alongside programming.
I used to do very well at my maths, but lost interest in large part because the maths I learned was largely disconnected from everything else I was doing despite an interest in programming.
It was first when I picked up a book on Prolog that I got symbolic derivation. The reason being that the Prolog book contained it as an example, and it was sufficiently compelling that it made me write an expression parser so that I could implement that symbolic derivation in Pascal, and the process of implementing the parser and implementing the rules applied to the syntax tree to carry out symbolic derivation brought it home in a way my teacher never did.
[Incidentally that expression parser also became the starting point for my first compiler.]
Of course programming can be distracting, because it can also allow you to explore almost any subject in more depth. E.g. what I know of complex numbers, I know because I was experimenting with fractals. What I know of graph theory is almost entirely down to playing around with parsing and compilation. And most of my understanding of trigonometry is down to toying with 3D rendering; certainly not from my maths classes in school that mostly made me loathe the subject.
There are plenty of languages that allows you to bridge a formal approach to maths with programming. But there are also plenty of ways to explore and demonstrate the concepts that will make them easier to grasp that require just very simple visualization. E.g. visualizing fractals as a means to explore topography; visualizing derivation, integration, limits, trig. For many of these presenting it as programs rather than visualization and letting students play with and see the consequences of changes has a lot of potential to make people grasp the concepts more deeply.
I understand where you're coming from. I'm often frustrated by how our industry allows software to be incredibly shoddy. But attracting kids to programming is not the same problem as making sure they grow into adults who do their job well.
Different ages have different priorities. The best way to attract kids to any activity, including programming, is to give them something fun to do. Let them make crappy stuff that's flashy and fun. If they choose to stick with it, teach them to do it well and help them unlearn the bad habits.
Incidentally, I consider bad habits to be incredibly important. Yeah, sure, you can read about how to program well, but it's not the same as having your own bad habit bite you in the ass and learning from it. It's even better if you learn bad habits and then unlearn them while you're still young and not when it might impact customers.
Just IMO, programming is addictively fun and can be shallow.
I can get that. In 1985 when I was programming my own BBS from scratch I would skip going out with friends to work on it. All that time spent on a computer as a child provided a very lucrative and rewarding career however so I don’t think I’d change any of it.
Ironically though based on your other comments in this thread I do wish I learned maths more!
I agree. Maths is more important than programming IMO. But wider skills (job-related, planning, and social skills) are just as important, probably more so. But programming is an almost magical process of animating a thing. It can be too attractive, addicting, distracting...
Just my POV. I should not have posted originally without some evidence to support my claim.
I also don't believe programming should be taught in schools, but for different reasons.
Not everyone is cut out for programming, and schools will inevitably teach it in a lowest common denominator style, where the bright kids will be bored to tears doing and redoing for loops in scratch.