Introducing C++

Read time: 12 minutes (3050 words)

It is time to leave our friend Scratch behind (except for one final project). We will now move to a real programming language. This is not going to be as much fun as Scratch, but I will try to make your lab projects as entertaining (and educational) as I can.

We will be exploring a programming language that is hugely popular out there, but one that is pretty complex as well. We will keep things simple in this class, since you are beginners. But we cannot avoid one big problem faced by students taking this course as a distance course - YOU need to install the program we will use.

Not to worry, this should not be too hard, and we will get into running it slowly, so you have time to figure all this out. I will also be available by email (or during office hours) if you get stuck!

Which language should we learn?

My first language was called FORTRAN (Formula Translator), a language designed for engineers who wanted to solve engineering problems like figuring out how air moves over airplanes. That language has been around in one form or another since the early 1960’s. It is still popular with the engineering crowd, but it is not a modern language, so we will not pick this one.

Surprisingly, most modern programming languages are similar enough that if you learn one of them, picking up another is fairly simple (not as hard as learning another spoken language at all). We will use a language that is probably the one used by more programmers than any other (at least today) – C++

This language is an evolution of an older language called C (The ++ notation in C means add one to this variable.) C is still around, and used in small computers, but C++ is the top dog, so learning a bit about this language will be a good way to begin your explorations of real programming languages.

Warning

C++, in all its glory is a complex beast. We will not be learning much about the language, just enough basics to show you how to write usable programs that run on your PC. We will try to make these programs fun, with some graphics thrown in to make things more interesting!

You write programs in C++, and this is different from writing a term paper. We do not use the same tools at all. A Program will be created using a text editor (not Microsoft Word). This will not involve any of that fun drag and drop stuff! You will be typing in things much the same way you create a term paper, only now the sentences in your language are called statements, and you need to learn new punctuation rules. Don’t worry, we will take it slow so you can get used to the idea.

To make this whole experience a bit easier, we will use a programming environment called CLion which is a single program that includes a text editor that knows all about C++. We will install a standard, high quality C++ compiler, a tool that converts your program into a form the computer can actually run. CLion also provides a simple way to run programs, nd it also has a debugging tool, and we can use that to explore your not-quite-running programs.

Before we can do anything, we need to install our new tool. So let’s get started!