Saturday, 3 May 2014

Programming Using the English Language


Remember what I said in the Introduction to this lesson?
   
      Writing software, computer programs, is a lot like
      writing down the steps it takes to do something. 
         
Before we see what a computer programming language looks like, let's use the English language to describe how to do something as a series of steps.  A common exercise that really gets you thinking about what computer programming can be like is to describe a process you are familiar with.
      Describe how to make a peanut butter and jelly sandwich.
   
Rather than write my own version of this exercise, I searched the Internet for the words "computer programming sandwich" using Google.  One of the hits returned was http://teachers.net/lessons/posts/2166.html.  At the link, Deb Sweeney (Tamaqua Area Middle School, Tamaqua, PA) described the problem as:
      Objective: Students will write specific and sequential steps
   on how to make a peanut butter and jelly sandwich.

      Procedure: Students will write a very detailed and step-by-step
   paragraph on how to make a peanut butter and jelly
   sandwich for homework. The next day, the students will
   then input (read) their instructions to the computer
   (teacher). The teacher will then "make" the programs,
   being sure to do exactly what the students said...
   
When this exercise is directed by an experienced teacher or mentor it is excellent for demonstrating how careful you need to be, how detailed you need to be, when writing a computer program.  
Programming in a natural language, say the full scope of the English language, seems like a very difficult task.  But, before moving on to languages we can write programs in today, I want to leave on a high note.

No comments:

Post a Comment