Just as a reminder, on Tech Tuesday I am currently going through what will be a pretty long cycle on programming. The overview post sets out a series of questions to be answered. The most recent posts on Variables, Constants and Literals and then on Data Types (Parts 1, 2 and 3) provide some of the basics for answering overview question 4 about how programs can refer to concepts as opposed just concrete things. There is a lot more to say about this but first we will turn to overview question 5 about how to break what we want the computer to do down into smaller steps.
The post on Programming Languages introduced the idea that each language comes with its own set of “words” known as keywords or reserved words (there are some subtle differences that we may or may not get to). These are our basic building blocs from which we put together longer expressions (think: sentences). By combining expressions we form programs (think: a complete explanation how to do something). The great news when you are just getting started is that in most programming languages there are relatively few reserved words altogether (30 - 100) and that you often need to know only a subset of these to get going.
var var = 5;
alert("Testing"); var alert = 5; alert("What happens here?");
If “alert” is a reserved word then we should get the same error we encountered before. But that’s not what happens! Instead we now see the following:
Next week we will learn about the largest group of reserved words in most languages - the so-called control structures, which tend to consist of words such as “if” and “while.” These are there to let us influence the flow of program execution.