Lesson 1: The Basics
Programming, in the sense we’ll discuss, refers to the act of writing in a special language to instruct a computer in what operations to take.
The Basics of Programming
Programming at it’s lowest level is simple addition and subtraction. Quite appropriately, this type of programming called “low-level” programming. When you go up various levels you get more complex mathematical functions like multiplication and division (which is just repetitive addition or subtraction). After that you eventually reach the level where you can use the various characters that we use normally (like letters and symbols).
Programming languages that utilize all of these characters and symbols are known as “high-level” languages. PHP and Javascript are both high-level languages.
Programming languages are languages, just like English. They have their own grammar and spelling rules, as well as common phrases and methods of arranging these words and phrases. Just like English, we refer to this by syntax.
Objective of these Lessons
The programming lessons won’t specifically allow you to create programs, because they will be talking in generalities, common between nearly all programming languages, and theories. However, this information is very important. In fact, it could be argued that knowing this information is actually more important than knowing the syntax of any specific language.
You should probably read these lessons before, or in unison with, the Javascript or Programming languages. Reading them together you will be able to understand the deeper concepts of the lesson, and then learn the language-specific syntax for those concepts.
Pseudo-Code
A technique commonly used when talking about the concepts and theories of computer programming is called pseudo-code, or “fake code”. Basically, pseudo-code is written in a way that resembles code, but isn’t necessarily a real programming language.
Throughout the lessons in this section we will make use of pseudo-code. This means that examples in the “Code” boxes are pseudo-code that you can’t necessarily run in Javascript, PHP, or any other language. The pseudo-code we use will make use of more words and less symbols then a typical language will, in order to help explain it better. You will be able to read a block of pseudo-code similar to a paragraph, which will help you understand it better.
Here is an example block of pseudo-code which is meant to be an if…else conditional which we will learn about in a future lesson:
Pseudo-Code
If valueA equals valueB Then
valueA equals valueB * 2
Else
valueB equals valueB * 2
End If
This is pretty easy to read in English if you just say it out loud, with a few grammatical discrepancies. Just for the sake of comparison, here is that pseudo-code written in Javascript:
Javascript Code
if valueA == valueB {
valueA = valueB*2
} else {
valueB = valueB*2
}
As you can see, the two are fairly simple in structure, but make use of more symbols then words. This is the beauty of pseudo-code; you can take pseudo-code and convert it into the proper syntax for any given language, once you understand the concepts and syntax.
In this lesson we briefly went over some basics of programming and discussed pseudo-code. In our next lesson, we’ll take a quick look at the history of computers, and talk about some of the inner workings of computers which is essential knowledge for becoming an excellent programmer and understanding what is going on behind the scenes.




