Mis à jour le 20/09/2018
  • 10 heures
  • Facile

Ce cours est visible gratuitement en ligne.

Ce cours est en vidéo.

Vous pouvez obtenir un certificat de réussite à l'issue de ce cours.

J'ai tout compris !

Introduction to programming

Connectez-vous ou inscrivez-vous gratuitement pour bénéficier de toutes les fonctionnalités de ce cours !

What's a program?

Since their invention in the 1950s, computers have revolutionized our daily lives! Calculating a route from a website or a GPS, booking a train or plane ticket, or seeing and chatting with friends on the other side of the world: all these actions are possible thanks to computers.

Nonetheless, a computer can only perform a series of simple operations when instructed to do so. They normally have no ability to learn, judge, or improvise. They simply do what they're told to do! Their value comes from how they can quickly handle and process huge amounts of information.

A computer often requires human intervention. That's where programmers and developers come in! They write programs, which are really just instructions to a computer.

A computer program (also called an application or software) is usually comprised of one or more text files containing commands, or instructions, in the form of code. This is why developers are also called coders

A programming language is a way to give orders to a computer. It's a bit like a human language! Each programming language has vocabulary (keywords that each play a specific role) and grammar (rules defining how to write programs in that language).

How do you create programs?

Programming languages

There are a large number of programming languages, each adapted to different uses and with its own syntax. However, there are similarities between the most popular programming languages. For example, here's a simple program written in Python, another popular progamming language, that tells the computer to show the word "hello":

print("Hello")

You can also write the same thing in PHP, which is yet another programming language:

<?php
    echo("Hello\n");
?>

Or even the language C#!

class Program {
    static void Main(string[] args) {
        Console.WriteLine("Hello");
    }
}

What about Java?

public class Program {
    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

All these programs display "Hello" through a different set of instructions.

Learn to code

Programs

Except in very simple cases, you don't create programs by writing source code directly. You'll first need to think about the instructions you'll want to convey.

Take a concrete example from everyday life: I want to make a burrito. What are the steps that will enable me to achieve my goal?

Begin
    Get out the rice cooker
    Fill it with rice
    Fill it with water
    Cook the rice
    Chop the vegetables
    Stir-fry the vegetables
    Taste-test the vegetables
        If the veggies are good
            Remove them from the stove
        If the veggies aren't good
            Add more pepper and spices
        If the veggies aren't cooked enough
            Keep stir-frying the veggies
    Heat the tortilla
    Add rice to tortilla
    Add vegetables to tortilla
    Roll tortilla
End
Mmmmmm!
Mmmmmm!

You reach your goal by combining a set of actions in a specific order. There are different types of actions:

  • simple actions ("get out the rice cooker")

  • conditional actions ("if the veggies are good")

  • actions that are repeated ("keep stir-frying the veggies")

We used a simple writing style, not a specific programming language. In fact, we just wrote what is called a program. We can define a program as an ordered sequence of operations for solving a given problem. A program breaks a complex problem down into a series of simple operations.

The role of the programmer

Writing programs that can reliably perform expected tasks is a programmer's goal. A beginner can learn to quickly create simple programs. Things get more complicated when the program evolves and becomes more complex. It takes experience and a lot of practice before you feel like you'll control this complexity! Once you have the foundation, the only limit is your imagination!

Exemple de certificat de réussite
Exemple de certificat de réussite