Oldskooler Ramblings

the unlikely child born of the home computer wars

How to explain programming to the total beginner

Posted by Trixter on June 6, 2017


Explaining what programming is in 2017 is likely best done by introducing the student to Scratch:  All logic is graphical, visual, and onscreen, which matches the most common output medium they’ll develop for.  But how do you explain programming like it’s 1979?

This topic came up recently in a vintage computer forum, where a long-time-listener-first-time-caller to the hobby decided they were going to do what they didn’t do in their youth:  Learn to program on their early home computers (which is one of the things they were originally marketed for anyway).  What struck me about this request is that the OP was truly coming from zero knowledge; they couldn’t comprehend how “ones and zeros” eventually turn into pac-man, or a drop-down menu, or a spreadsheet.

To help explain what programming itself is to the total layman, I came up with a metaphor that I thought was simple enough that I’d reproduce it here:  Programming is like cooking.

How is programming like cooking?  Well, how do you cook food?  To cook food, you need raw ingredients, cooking utensils, and recipes.  You read the recipe, which tells you which utensils to use on which ingredients and in which order.  The end result is a meal.  How does this relate to programming?  Like this:

  • Cooking utensils = CPU instructions
  • Raw ingredients = data
  • Recipe = A computer program

A program is a list of steps (recipe) that use different CPU instructions (utensils) to process data (ingredients) into a new format (a meal).  That’s all programming is.

Okay, but how do you make anything of any complexity, like a game or a drop-down menu?  Let’s extend our cooking metaphor:  Say you had to provide a ton of different, complex meals for a large catered event.  To do this, you have several recipes, each producing a different result.  For such a large event, it’s possible that some recipes exist only to create portions of food that themselves are used in larger recipes for a more complex meal.  The process is no different than making a single meal — you’re just doing it a lot more, with more recipes, for a bigger and more complex result.  How does this relate to programming? Like this:

  • Catered event = A complex thing the user sees on the screen
  • Many recipes = Many different programs
  • Smaller recipes that produce food to be fed into the larger recipes = Subroutines, library calls, API calls

I admit, I was eating lunch when I came up with this metaphor.  But maybe it can help you explain programming to your grandparents.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: