Thanks for the question, Bice.
An honest answer might be ‘that’s too complex to put in a post’, but I’ll try.
Every computer language has some underlying paradigm - a mental model of how the machine ‘works’, and how we communicate what we want the computer to do.
Imperative languages are like a micromanager. (not a disparagement in itself, computers are not people). Do this, then do this, then do this, then, if X is less than 3, go back to step 7
The majority of programming is done in such imperative languages, although we in the computing industry are questioning this now. But the languages you probably have heard of - Java, Ruby, Basic - are all imperative languages.
Functional language express everything as a mathematical function. The computer evaluates the function. Since everything is a function, they can be ‘composed’, and in many ways functional languages are particularly good at something called the problem of state.
Logic languages let the programmer describe a ‘knowledge base’ of facts and rules about how the world works. Then the programmer asks the system to find proofs of some fact - like ‘is there any value that makes this a penguin?’ - yes, a 4 makes this a penguin acording to the rules you’ve taught me. So logic language programmers are more like the good manager - setting objectives and stating requirements.
Reactive languages established fixed relationships between fluents. If you can use Excel you know a reactive language. When the value in one cell changes, the value in cells that depend on it are recalculated.
So, this must be great fun for those of us who wear pocket protectors, but what’s it to do with education?
Functional languages, and even more so, logic languages, have good mathematical properties. They can be reasoned about in a way that imperative languages can’t. They have an ‘object’ relationship in the world (Montessori would love that) that imperative languages do not.
And, our experience is that learning a functional or logic language FIRST gives one an advantage in programming ‘thinking’ that stays with the student after they learn an imperative language.
A similar situation occurs with welding - if someone first learns to ‘stick’ weld, and then ‘mig’ weld, they will forever be a better welder than someone who learns in the opposite order. It’s a matter of developing good habits from the start. (there is little call any more for stick welding, mostly it’s done mig in industry, but the learning pattern is still true).
So, we are teaching our children ‘mig’ first when we teach them an imperative language first.
Programmers who started with imperative languages find it difficult to learn logic or functional languages. Programmers who start with functional languages find it easier to transition to imperative languages.
Concern about this has lead to the Snap! system out of UC Berkeley, in many ways a follow on to Scratch.
Interestingly, in the 70s Kowalski experimented with using Prolog, a logic language, to teach K-8 students not ‘programming’, but to reason. After an introduction to Prolog, the students were asked to make simple knowledgebases that demonstrated reasoning and relationships among facts taught in class.
An odd thing happened to me once. I was asked to be a visiting lecturer at a college class as an expert in Prolog, via videoconference. The request came with minimal informaiton, and I assumed this was a computer science class.
Instead, it was a cognitive science class, an elective at a community college. Neither the teacher nor students had any prior experience in programming, yet they’d managed to adapt a popular online tutorial in which one builds an expert system in Prolog, and much of the class was taken up by demonstrations of the students expert systems!
What really suprised me about this is that I also come into contact with large numbers of students in undergrad BSc computer science programs who are taking the conventional ‘programming languages’ component. These are students who have programmed daily for at least several years at this point. But when they’re introduced to Prolog they find it mind bendingly, hair tearingly difficult.
But I had a friend whose only programming experience was making an HTML page ask me to teach him to program. I suggested he learn Snap and Prolog. While he found Prolog more difficult than Snap, he was able to pick up the fundamentals of both in an afternoon, enough to develop skill independently, and recently plied me with questions about a project he was planning in Prolog.
So, IMHO, a better language for introducing children to computing would be a reactive, declarative, or logic paradigm agent based language which used a Scratch-like syntax forcing function in an IDE and which treated the scene graph as a first class citizen.
::Annie gets down off her stump::