I'll leave the part of "coding is important because computers are everywhere and learning how to automatize everyday things is a great skill" to others, as there are lots of excellent comments about it in this thread. Let's talk about something different:
> But understanding variables and functions, pointers and recursion? I can't see it.
Hey, I'd argue that understanding exactly those things are what should be included in "everyone should learn to code". All of those are difficult mental constructs important for understanding how our complex world works. Let's look at it case-by-case:
variables - this is basic; the idea to take something (a concept) in your hand and manipulate it by a symbolic name. This is, in some way, taught in high-school math, but somehow many people don't seem to grasp the idea behind the concept of a variable.
functions - ability to take a set of instruction and name it. Possibly have it parametrized. That's simple. But naming several sets of concepts, and then using them to build another layer of concepts, which is then used to build another layer of concepts... I'd call this an essencial problem-solving skill.
pointers - concept of indirection; for people not accustomed to it, it's easy to get lost in different levels of indirection when discussing things
(like, a difference between 'belief' and 'belief in belief', or P, proof of P, proof that P is provable, etc.)
recursion - because not everything circular is invalid; sometimes things defined in the terms of themselves are the simplest way to go.
To all of this I'd also add one more, IMO essencial, thing - understanding of feedback loops. It could cut out a lot of discussions about whether X causes Y, or Y causes X. Surprise surprise, it might be a feedback loop, in which X and Y are interlocked, and are both to blame.
Bottomline, programming teaches us a lot of important skills and mental constructs useful for problem-solving and understanding how the world works. And those skills are hard to get elsewhere.
A silly example from high-school biology: what is genetic code if not opcodes for protein assembly machinery? DNA "data" is code that programs machines building proteins. Easy to understand and remember if you know even a little bit about how 'automation'/'computing' is done.
Bottomline, programming teaches us a lot of important skills and mental constructs useful for problem-solving and understanding how the world works. And those skills are hard to get elsewhere.
I definitely support the notion that everyone should learn problem solving skills, but people can take different paths than programming: mathematics, natural sciences, and even chess, for example.
As Richard Rusczyk, founder of Art of Problem Solving, says, “We use math to teach problem solving because it is the most fundamental logical discipline. Not only is it the foundation upon which sciences are built, it is the clearest way to learn and understand how to develop a rigorous logical argument. [...] This is not to say that those who cannot do math cannot solve problems. There are many paths to strong problem solving skills. Mathematics is the shortest.” [1]
And there have been many studies on the relationship between chess and problem solving, including this one by Ferreira and Palhares [2].
> I definitely support the notion that everyone should learn problem solving skills, but people can take different paths than programming: mathematics, natural sciences, and even chess, for example.
I agree, though you'd have to go far over the school level of maths to get such benefits. Also, given that CS is a part of math, you can't avoid it if you want to learn some mental structures - we actually DID invent a new way of thinking in the last 100 years. And CS should be, in my opinion, tangled with programming, for a mortal to understand it and have fun with it at the same time.
So, in other words, by all means study math, but catching a bit of CS knowledge and programming skills at some point should be a natural consequence of it.
[...] you'd have to go far over the school level of maths to get such benefits.
Not at all. Even deriving the formula for the sum of the first n positive integers is something that requires problem solving skills while not requiring more than school-level maths.
Also, given that CS is a part of math, you can't avoid it if you want to learn some mental structures [...] by all means study math, but catching a bit of CS knowledge and programming skills at some point should be a natural consequence of it.
Huh? Physics is more a part of mathematics than computer science is. And I don’t understand what you mean by “mental structures”.
we actually DID invent a new way of thinking in the last 100 years
Could you explain what you mean by that?
Anyway, my point was that you can’t argue that everyone should learn programming just because it’s a way to learn problem solving.
> But understanding variables and functions, pointers and recursion? I can't see it.
Hey, I'd argue that understanding exactly those things are what should be included in "everyone should learn to code". All of those are difficult mental constructs important for understanding how our complex world works. Let's look at it case-by-case:
variables - this is basic; the idea to take something (a concept) in your hand and manipulate it by a symbolic name. This is, in some way, taught in high-school math, but somehow many people don't seem to grasp the idea behind the concept of a variable.
functions - ability to take a set of instruction and name it. Possibly have it parametrized. That's simple. But naming several sets of concepts, and then using them to build another layer of concepts, which is then used to build another layer of concepts... I'd call this an essencial problem-solving skill.
pointers - concept of indirection; for people not accustomed to it, it's easy to get lost in different levels of indirection when discussing things (like, a difference between 'belief' and 'belief in belief', or P, proof of P, proof that P is provable, etc.)
recursion - because not everything circular is invalid; sometimes things defined in the terms of themselves are the simplest way to go.
To all of this I'd also add one more, IMO essencial, thing - understanding of feedback loops. It could cut out a lot of discussions about whether X causes Y, or Y causes X. Surprise surprise, it might be a feedback loop, in which X and Y are interlocked, and are both to blame.
Bottomline, programming teaches us a lot of important skills and mental constructs useful for problem-solving and understanding how the world works. And those skills are hard to get elsewhere.
A silly example from high-school biology: what is genetic code if not opcodes for protein assembly machinery? DNA "data" is code that programs machines building proteins. Easy to understand and remember if you know even a little bit about how 'automation'/'computing' is done.