The Turtle System

I’ve always been a huge fan of Logo as a way of teaching programming: not just the use of turtle graphics to provide immediate visual feedback, but also the way the structure of the language naturally leads students through key programming concepts as they learn how to draw increasingly complicated shapes.

So I was rather delighted whilst at BETT to discover Peter Millican’s Turtle System. Originally written with Pascal in mind, it’s now being developed to use a simplified version of Java to produce turtle graphics and more.

The system comes as a lightweight Windows exe (which runs perfectly fine on Linux under WINE) and a simplified browser based version.

To program in Java…

  1. View|Display Power User Menu. Amongst other things, this will make the Language option appear in the menu bar
  2. Choose Language|Java. This is the preliminary version. I notice that a Python and BASIC version are still to come.
  3. Choose Help|Illustrative Java Programs to see some samples. Notice the simplified syntax in the main() method signature.

Sample Program

class drawPause
{
    void main()
    {
            colour(green);
            blot(100); //green blot
            pause(1000); //pause 1 sec
            colour(red);
            forward(450); //red line
            pause(1000);
            right(90); //90 degrees
            thickness(9); //thickness 9
            colour(blue);
            pause(1000);
            forward(300); //blue line
    }
}

 

HTML, DOT and Non Turing Complete Languages

I’ve written elsewhere about why I think students should learn textual programming.  One point worth restating is that in my experience it isn’t the syntax that causes students problems when learning to program, it’s the structures.

So why not teach students languages where the confusing structures don’t exist?  And by confusing structures, I mean loops and branches, these are confusing enough for beginners.

Let’s stop there for a moment.  The fact that you’re reading this blog means you’re probably a competent programmer.  You’re probably thinking that there’s nothing very difficult about looping and branching, these are basic concepts, and of course they are.  If you don’t understand these, you can’t program.  And that’s the point I’m trying to make.  Some students will struggle with the concept of a simple loop to print out the numbers from one to ten.  Many more students will struggle to apply that concept of a loop to problems, for example to realise that a simple password entry procedure requires a loop.

I think that it’s a good idea to avoid loops and branches when students begin coding.  Non Turing Complete Languages such as HTML and DOT give students a chance to learn syntax and to get a feel for coding environments whilst getting immediate visual feedback on what they’ve done.   I think that DOT is a great place to start, it’s a real world language with a definite use, one that can be of benefit to most users.  I’ve written more about DOT here.  Follow the link to my Dot and Graphviz Tutorial.

Why We Need to Define the Difference between Coding and Programming

A quick search on the Internet suggests that the majority of people say there is no difference between the two terms.

Well, I’m going to suggest a difference: from now on I’m saying that programming is the general term, and that coding refers specifically to text based programming.

It’s quite straightforward: you program your digital video recorder, dishwasher or home alarm system. you code in Java, Python or C++

It’s a useful distinction. It allows you to distinguish between programming in languages such as Scratch, and coding in languages such as Logo.

The National Curriculum in England requires pupils to “use two or more programming languages, at least one of which is textual”, obviously recognizing the importance of coding.

Why is coding so important?

From the standpoint of the professional, it’s important because that’s how you get things done. Programming languages are too restrictive, you’re restricted to the functions built into the language. All the jobs are in coding.

But I believe there’s an important pedagogical reason: coding gives students a better understanding of how computers work. Coding means that students learn syntax and structure. The syntax of coding can be off-putting, it’s an extra thing to learn and it can be difficult for low literacy students. But my experience is that it’s not the syntax that students struggle with.

It’s programming structure that students need to understand. Visual programming languages such as Scratch give the appearance that students are learning. They can produce impressive programs very quickly, but do they really understand what’s going on?

My experience suggests no. It’s not until students begin coding that they really understand structure.

What’s Wrong with the Raspberry Pi?

Nothing, as such. The Raspberry Pi is a great piece of equipment, a fully working computer available for only a few pounds.

The problem with the Raspberry Pi is its suggested use as a teaching tool. The very existence of the Raspberry Pi is an example of one of the most common fallacies in teaching – “I learned something this way, and it worked, so therefore everyone else must learn things this way as well.”

Like most people my age I learned to program in BASIC on very simple machines: Sinclair ZX81s and VIC 20s. What worked for me when learning programming was a simple machine that I could understand fully. But I was interested in programming, and I was willing to put up with the difficulties of a text based interface. Most importantly, those machines were the only computers I had ever seen.

Things are very different today. Children have grown up in a world of computers. They have a very different understanding of what a computer is and what it can do than we did. Getting them to program in Python on a stripped down box merely suggests that such things aren’t possible on a regular PC. It’s far better to get them to download an SDK onto a machine they’re familiar with than to get them started in a completely strange environment.

One last thing: Raspberry Pis aren’t even cheap. The machine itself may be, but you still need a monitor, a keyboard and mouse, and most importantly in a school, somewhere to set them up. And unless you intend to only set them up before each lesson, they are going to sit there doing nothing for most of the time. Of course, you could always put them on a trolley. Putting computer equipment on trolleys has been a great feature of British Education over the past twenty years. The school computers in this country must have covered more miles to less effect than the IT equipment of any other nation on Earth.

If you’re looking for something simple and cheap, the best machine you can get your hands on is on old PC installed with Lubuntu. Many British families probably have an old PC at home that they could use already. What better way to learn to learn about computers?

Coders or Priests?

Why bother learning to read 800 years ago? What few books that existed back then were way beyond the means of the common person, and contained little information of use to everyday life. The one book that the typical westerner might imagine needed access to was the bible, and this was denied to them. The bible was the property of the church, chained down so that the non-clergy couldn’t get their hands on it.

And then came the Reformation. This was the point at which learning and the study of ancient languages came together with the impact of the printing press. Moreover, it was advantageous for some German princes to espouse the cause of the reformers, not because they agreed with the ideas, but because it gave them, some political leverage in the power-politics of C16 Europe.

The printing press meant that there were books, and people had the opportunity to read them. No doubt there were many at the time who said that there was no point learning to read, there were already priests who could do that for them.
Fast forward to almost the present.

In the 1980s computers first made their way into peoples homes. Everyone had the opportunity to learn how to program computers: the British Government and the BBC felt this was such a useful skill they produced a scheme to help people to do just that.

All went well until programming fell out of fashion in the 1990s. It was felt to be too hard and, when you got down to it, unnecessary. After all, the argument went, you don’t need to know how the internal combustion engine works in order to drive a car.

Is that really true, though? You know that a car needs fuel, that you can’t let it get too hot, you know that you need to check the oil. You know where the engine is in the car, and you probably know someone who can fix it when it goes wrong.
Learning to program computers is important. Not everyone needs to program computers, it’s true, but everyone should have an understanding about how the machines actually work, and this understanding comes from knowing how to program. If you can’t program, how do you if someone is telling you the truth when they say that computers can’t do something? If you don’t understand coding, how do you know that you’re not being lied to about the capabilities of the technology that drives the 21st Century? Facility in coding is labelled as the sign of the geek, the nerd, the unwashed, friendless teenage boy. It’s certainly not for the cool kids, or girls, or those over thirty, or those who are too busy doing something else.

Or is that just what they want you to believe?

Everyone needs to know about coding. You don’t need to be an expert, but you should be aware that what’s happening inside your smartphone is not magic.
If you don’t, you’re handing back control of your life to a new set of priests.

Air Force Collaboratory

The US Air Force have sent me details of details of their Air Force Collaboratory project, which they describe as “the first collaborative platform dedicated to solving some of our science and technology challenges.”
As it says on their website

Solving the Air Force’s toughest challenges requires a collaboration platform unlike any other. The Collaboratory was built from the ground up so you and a community of peers could work alongside real Airmen on real Air Force projects. Your idea could change everything. So let’s get started.

This looks to be a well designed website working on high end problems, you might find it fascinating…

Find out more here: https://collaboratory.airforce.com/

Steps to Learning Programming

There are lots of programming languages designed to make learning programming easier. In my experience they are a waste of time for most students. Many of the languages will allow students to make apparent progress and to produce what appear to be impressive applications, but if students don’t understand what they’re doing, they’ll quickly lose interest.

Here are the things that students need to learn, and the rough order in which they need to learn them.

  • Imperative commands such as PRINT “hello”
  • Variables and types, particularly the difference between strings and numbers
  • Simple arithmetical operations e.g. a = 3, b =4, c = a+b
  • Branch commands such as IF answer = “Paris” THEN PRINT “Correct”
  • More complicated branch commands – IF THEN ELSE
  • For loops or equivalent
  • While loops or equivalent
  • Nested branch commands
  • Nested loop commands
  • Arrays
  • Traversing Arrays using for loops and while loops
  • Functions and Procedures, or equivalent

And that’s it. Everything else in programming can be achieved using the above. The rest is just readability, convenience and elegance

The problem with some languages, particularly the visual ones, is that students produce results without understanding the above. If students don’t understand the above, they don’t understand programming.

Python allows you to teach all of the above. And then once the student has learned, they can build on what they know, replacing the pieces of their Python toolkit with more advanced constructs as they learn. And as programmers, they’re always learning…