Overview of Programming Languages

We are studying Programming in this course, but what exactly is that, anyway?

Programming

A Definition:

Programming is the art of writing down a sequence of statements in some language that convey precisely the actions we want a computer to take on our behalf to solve some problem.

I highlighted a few terms here, what do they mean?

Language

You know what a language is, in your high-school English class (or whatever you took as its equivalent) you learned a bunch of rules that defined how you construct legal sentences in the language you were learning. We called these rules the grammar of the language. In programming, we have many languages to choose from, and often there are some languages better suited to certain problems that other languages. (Programming is not about any one language, it is about making the computer do tricks for us - in any language we choose!)

Statements

In programming, statements are the equivalent of sentences in English.

Precisely

Boy, this one is important! No matter how much you might like it to be so, a computer will only do what you actually tell it to do, not what you meant to tell it what to do, or what you want it to do!

Actions

Every statement in a programming language has some meaning. We need to learn what that meaning is. Some statements cause information to be set up inside the computer, and other statements cause that information to be modified in some way, or moved from place to place. We must understand exactly what will happen when the computer processes each statement in our program.

Computer

Well, obviously, we are learning about programming computers, those patient, fast, simple electronic gadgets we can hook up to all kinds of stuff and make neat things happen. The languages we are interested are those invented to express our wishes to computers!

However, those languages are also designed to express our wishes to other human beings as well! You may well be the author of a program, but other folks will need to use that program, fix that program, or evolve that program, so we need to take care when we craft these things!

So, what are the things we will learn?

In learning about these programming languages, we will be using symbols from the standard alphabet (including punctuation marks), found on the normal computer keyboard.

We will learn how to arrange a small set of these symbols into something that look like words, (just like in English - with spaces or punctuation marks separating them) each of which will be used for some specific purpose.

We will learn how to arrange these words, together with some additional punctuation marks, to form sentences in the language we are using. We will need to learn the grammatical rules for the language so we can decide if the sentences are legal or are gibberish. These rules define the Syntax of the language.

We will need to learn exactly what the computer will do when it processes each sentence. The meaning of the sentence is called the Semantics of the language. In the computer world semantics can be defined mathematically - which leads to very interesting ways to manipulate programs to create other programs with exactly the same meaning!

Finally, we will learn how to arrange a set of sentences into larger blocks called programs. Our knowledge of the meaning of each sentence will allow us to think about how the computer will work through our program, and what it will do. As we do this thinking, we should be able to convince ourselves (and others) that our program is correct.

A lot of detail to think about and study, but, in the end, this can be a lot of fun!

Why so many Languages?

Humans work on problems all the time. Each group of people working together to solve a class of problem tends to design a notation that makes it easy for them to express themselves clearly. Look at all the funny symbols mathematicians use to do their work! When these folks start asking the computer to help them, they often want to be able to use the same notation in their programs. So, they may well design a language that is easy for them to work with. They probably do not care if this language is going to be useful to any other group of people working on other problems. Some people do try to build general purpose languages, but these languages never seem to satisfy everyone.

So, we have a fair number of languages available to choose from to build programs for our computer. Each should be studied to see what kinds of problems it works well with, and that knowledge stored away for future reference. When you have a specific problem to solve, choose the language best suited to that problem (if your boss gives you the choice!).

What you really need to understand is how to make the computer do the tricks you want, then find out how to express those wishes in the language you have chosen for your program.

We will be using C++ for most of this course, because it is the most commonly used language around today. Tomorrow, who knows!