Graphic Languages vs Text — Changing my Mind?

Maybe not exactly changing, but thinking things through. (Sounding like a politician?)  Whatever, here’s my latest thinking:

Graphical languages:  Think Scratch  (desk & laptops)  Hopscotch or Scratch Jr.  (tablets) — but LOTS of others.

Text Languages:   Think Python, Java, JavaScript, C, C++, C#, agin LOTS of others.

I’ll use Scratch and Python as examples, but what I say will apply to all of them.

Here’s what you usually hear.  “Little kids start with Scratch and then graduate to Python when they get older.”

A few brave souls will tell you that they have (or know of) a way to learn Python without going through the Scratch experience — implying that time is really wasted on Scratch.

(BTW, If you’ve never programmed, then some of my comments will seem either trivial/obvious or hard to understand.)

A big advantage of Scratch is that you move blocks and objects around on a screen — no typing.  True, for some, but many (most?, all?) have cell phones and can type like demons.

A Scratch disadvantage is that the screen gets full of blocks quickly, so even moderately complex programs are hard to “see”.  Python, OTOH, reads like a book — and we’re all used to reading books.

I’ve been, pretty much, in this later camp — probably because that’s how I learned and spent my programming life writing fairly complex programs.  The blocks do not help me visualize the program.  Scratch was born in 2003, when I was 67, after some 46 years of programming.  (built in bias)

Do you remember when Microsoft Windows came into being?  1985, and it was very sluggish.  Folks knew how to make windows & mice work before that, but the hardware was too slow to make it practical.  Look at where we are now in just 30-some years.

I’m biased, by my experience, but I’ll try and put some of it aside.  Almost all Python programs are linear (do things one-at-a-time).  Example: You have a pile of financial data and want a program to take those numbers, do some calculations (like add up revenues) and print or display the “answers”.  It’s called  Procedural Programming, better,  Input-Process-Output, or IPO logic paradigm.

In the 90’s another way of programming dealt with objects.  it’s called Object Oriented Programming (nice discussion, here)  or OOP.  If you Google OOP vs IPO you’ll get over 800 thousand hits.  Most of the programs written today favor the OOP paradigm.  Why? Well, most folks feel that very complex programs are easier to write, have fewer bugs, and are easier to maintain.  As the politicians, say, it’s complicated, but vote for it & they’ll then tell you why it’s better ?

Scratch has objects on the screen (called sprites) that do things.  Each sprite can run independently and can send and receive messages from other sprites and act on those messages.  Very intuitive in a graphical environment — less so with Text.

Aside: the reason this can work well is that modern computers have multiple-cores and can do different calculations at the same time.  Almost like having different physical computers working along side each other.  Tricky stuff, for sure, but think of anything that we humans do.  Lots of simultaneous actions.  I’m typing this, listening to a CD ( one of mine actually), chewing on a protein bar.  The phone rings — I stop typing and answer it, but I do not stop the CD — or throw away the protein bar.   Hard to simulate that with a linear process. (Possible if you break the different processes down into small enough pieces, but that’s very hard & tedious to do.)

Point is that we do all sorts of things simultaneously.  Interrupts change things, messages receive cause changes (take out the garbage?)  Play a computer game. You are constantly interrupted — and you are constantly interrupting the code that runs the game.  Each interruption usually causes an action change — from both you and the computer.

The other reason for using Scratch is that beginners, especially school kids don’t program every day.  It’s much easier to remember how to move the labeled blocks around to make their program.  Finding the right block is easy.  If they are using Python, they will have to remember the syntax exactly –or more realistically, look it up.  No problem if you are an everyday programmer, you have internalized all of the syntax,

For a beginner who knows that she needs a loop to execute some commands, but doesn’t remember the exact syntax, Scratch makes it easy.  Just look and find the loop block.

So, you don’t have to start with Scratch, but if you are not at it every day, it makes life a lot easier.  Thinking of the sprites as objects and all that involves is very natural — a big advantage.


Print Friendly, PDF & Email