When people talk about teaching programming in schools I think that's a wonderful idea. The problem is, how many are actually teaching programming?
From what I can tell, most are teaching coding.
Heck, a lot seem to be conflating HTML markup with programming which is even more concerning.
Fact is, coding is often the easiest part of programming. Certainly, it can be the easiest part to teach lazily.
The difference between programming and coding
Programming is applied problem-solving.
- Specification - What is the problem you wish to solve or what do you need the program to achieve? Define the inputs and outputs.
- Algorithms - How should the program work the problem in order to achieve #1?
- Testing and QA - When will you know your program is successful?
Coding is turning a solution into machine-readable syntax.
Back in the day
One of the ways programming was taught at schools in the 1980s was through "Turtle".
The idea was there was a robotic turtle that you needed to provide commands to, and rather than aimlessly drive the turtle around you would need to get the turtle to achieve something specific.
While the "language" was very simple, such as forward, rotate, etc, the concepts of programming and planning ahead were very quickly learned on the go. By watching the turtle move on screen, or in a physical robot of your school was wealthy, you could see the results of your code (and crashes were real crashes!) but also these robots had real or virtual pens, that could draw.
Initially, the student would be told to draw a square. Then a circle. Before progressing to things like loops and recursion - can you shrink your code down by removing unnecessarily repeating statements?
Before long kids were producing highly complex shapes just by breaking down the problem (or design) into component parts and using math to their advantage.
In robot scenarios, the student might achieve victory by getting the little turtle guy over to the teacher's desk while avoiding the trash can along the way.
Why is this important?
First of all, "hacking" away at a program in code produces buggy, inefficient, difficult to maintain software.
Second, if you teach people to "code" rather than programming, they are learning one specific implementation and the quirks of that language or environment, rather than a transferrable set of skills that have applicability in all areas of life, not just in creating programs.
How programming produces better results in software
Programming doesn't need to be some university-level science thing, I learned mostly self-taught across several programming languages until I did a night class in "Structured Systems Analysis and Design".
The main factor is as a coder, without any consideration for "programming", you are relying on "syntax errors" and an "I will know it when I see it" attitude for quality control mainly.
On the other hand, if you work out what your software should do and how it should do it ahead of time, then you have a better benchmark to compare your software to.
As an example, consider a simple list sorting program.
If you start coding, hacking away at the code as you think of subroutines you need to add, testing, and going back to the code editor, you will end up with no warning messages at some point, but does that mean you are done?
What kind of lists do we want to sort? Shopping list? To-do list?
And do we want to sort alphabetically? Chronologically? Smallest to largest or reverse? Do we need to allow the option to choose?
Where will the lists come from? Will there be a UI? What validation will we do?
The joy of coding
This is not at all to say learning coding does not have a strong place.
In my history as a teacher of all things computing, I have found a great way to teach programming is via coding.
People want to see things happen when they apply effort and want to see progress as time passes. Front-loading with lots of abstract theory loses the interest of the majority of your students.
This is why my retro website is called Retro Game CODERS.
I like to teach things like data structures, algorithms, error trapping, and version control, in the context of producing working software.
It doesn't matter if the "language" is drag and drop, BASIC, or C, though personally, I find throwing people into pointers, memory management, or OOP too early tends to make their eyes roll into the back of their heads rather than gain a passion for programming!
Over to you
What do you think?
Disagree? Does it even matter?
Are you old enough to remember logo and turtle?
Should schools even teach this stuff?