Programming is a subject that fascinates a lot. If you are reading this course, you have decided to take the plunge and find out what it is all about. However, before you start learning anything about programming, it is necessary to first find out what programming is all about. For the moment, you don’t really know what programming is, what “programming” means, or what characterizes a programming language.
What is programming?
Programming is a branch of computer science that is used to create programs. Everything you own on your computer is a program: your Internet browser (Internet Explorer, Firefox, Opera, etc.), your operating system (Windows, GNU/Linux, Mac OS X, etc.) which is a grouping of several programs called software, your MP3 player, your instant chat software, your video games, etc.
The Program Explained
A program is a sequence of instructions, orders, given to the computer to perform actions. These instructions are usually fairly basic. We find instructions for addition, multiplication, or other basic mathematical operations, which make our computer a real machine to calculate. Other more complex instructions may exist, such as operations to compare values, process characters, etc.
Creating a program is simply using a basic set of instructions that will allow you to do what you want. All programs are created this way: your MP3 player gives instructions to the computer to listen to music, the chat gives instructions to chat with other people on the network, the operating system gives instructions to tell the computer how to use the hardware, etc.
Note that it is not possible to create instructions. These are printed in the computer’s circuits so that it can only handle a specific number and therefore it is not open to you to build new ones (except in real cases).
Our computer contains a particular electronic component, specially designed to execute these instructions: the processor. The important thing to remember is that our computer contains a circuit, the processor, which allows for small basic treatments called instructions and which are the basis of everything found on a computer.
The instructions are stored in our computer in the form of binary numbers (called bits in English), in other words in the form of zeros or ones. Thus, our instructions are nothing but suites of zeros and ones kept in our computer and that our processor will interpret as orders to be executed. These suites of zeros and ones are difficult to understand for us humans, and talking to the computer with zeros and ones is very tedious and very long. Suffice to say that creating programs this way is like shooting yourself in the foot.
To give you an example, imagine that you had to communicate with a stranger when you do not know his language. Communicating with a computer would mean having to give it a sequence of zeros and some, the latter being unable to understand anything else. This language is called machine language.
One question must certainly come to mind: how do you communicate with our processor without having to learn its language?
The ideal would be to talk to our processor in French, English, etc., but let’s be clear: our technology is not advanced enough and we had to find something else. The solution chosen was to create programming languages that are more advanced than machine language, easier to learn and to provide the translator who goes with it. These are fairly simplified languages, often close to natural languages and in which we can write our programs much more simply than using machine language. Thanks to them, it is possible to write our programs in text form, without having to deal with sequels of zeros and some totally incomprehensible. There are many programming languages and one of them is C.
However, our processor does not understand these advanced languages and knows only one: his. Also, to use a programming language, you need a translator who will link it to the processor’s machine language. This way, you no longer need to know the language of your processor. In computer science, this translator is called a compiler.
Ready to learn programming now?