Apprendre La Programmation

Cette page va te servir de point de référence pour l’apprentissage de la programmation. Je vais y mettre les liens importants pour que tu n’ai pas à prendre des notes. Apres avoir fait tout ca, tu seras en mesure de postuler pour des postes de programmeurs junior ainsi que d’avoir une introduction au metier de programmeur analyste et des concepts des “design patterns” enseignés en computer science a l’université.

Les Outils

Voici les applications et les livres que nous allons utiliser. Tu peux clicker sur les liens en gras pour plus de details.

Les Étapes 

Voici les étapes dont nous avons discuté. A la fin de la 3 étapes, tu sera en mesure d’écrire tes propres programmes et savoir ou chercher pour trouver des réponses. Cette liste n’est pas coulé dans le béton — je vais adapter le materiel base sur ton feedback et ta façon d’apprendre.

Important — Je vais écrire tous les details techniques et les commentaires en Anglais car c’est la langue internationale de l’informatique.

  1. Computers And Software

  2. Windows/DOS Command Line — 1 week

  3. The C Programming Language — 4-6 months

  4. Design Patterns —2-3 months

  5. History of computer programming — 1 week

  6. Web App Programming — 1-2 month


1. Computers And Software

Computer Software Stack

A computer has several layers of software, each depending on the previous layer. Those layers are illustrated in the diagram bellow:

A complete picture of the software stack. System software includes the firmware through the OS levels of this model.

  • Hardware — Computer components: microprocessors, RAM memory, battery, disk drives, etc.

  • Firmware (BIOS) — System software used to “boot-up” the computer.

  • Hypervisor (Optional) — A type of system software used to emulate other machines. Ex: a Windows PC can run different versions of Windows, Linux or BSD UNIX.

  • OS Drivers and runtimes — Part of the OS that runs peripherals such as printers, graphic and audio cards.

  • OS Services — Part of the OS that provides services to all applications. Ex: networking, printing, file system operations, font management, etc.

  • OS UI — Part of the OS that provides a user interface (UI) for the user to interact. Ex: Windows, views, keyboard entry, mouse entry & multi-touch entry.

  • Middleware — Applications that come with the OS. Ex: database, audio/video recording, etc.

  • Application — Applications that run on the OS, using its UI, services and drivers.

Computer Languages

Over the years, computer languages have been evolved from Low-Level to High-Level Languages. In the earliest days of computers, only Binary Language was used to write programs. The computer languages are classified as follows:

Machine Language (low level language)

Low-Level language is the only language which can be understood by the computer. Low-level language is also known as Machine Language. The machine language contains only two symbols 1 & 0. All the instructions of machine language are written in the form of binary numbers 1's & 0's. A computer can directly understand the machine language.

Assembly Language (middle level language)

Middle-level language is a computer language in which the instructions are created using symbols such as letters, digits and special characters. Assembly language is an example of middle-level language. In assembly language, we use predefined words called mnemonics. Binary code instructions in low-level language are replaced with mnemonics and operands in middle-level language. But the computer cannot understand mnemonics, so we use a translator called Assembler to translate mnemonics into machine language.

Assembler is a translator which takes assembly code as input and produces machine code as output. That means, the computer cannot understand middle-level language, so it needs to be translated into a low-level language to make it understandable by the computer. Assembler is used to translate middle-level language into low-level language.

g++ -S main.cpp -o main.s

High Level Language

High-level language is a computer language which can be understood by the users. The high-level language is very similar to human languages and has a set of grammar rules that are used to make instructions more easily. Every high-level language has a set of predefined words known as Keywords and a set of rules known as Syntax to create instructions. The high-level language is easier to understand for the users but the computer can not understand it. High-level language needs to be converted into the low-level language to make it understandable by the computer. We use Compiler or interpreter to convert high-level language to low-level language.

Languages like FORTRAN,C, C++, JAVA, Python, etc., are examples of high-level languages. All these programming languages use human-understandable language like English to write program instructions. These instructions are converted to low-level language by the compiler or interperter so that it can be understood by the computer.


2. Windows/DOS Command Line

The command line is the foundation of any computer operating system (OS). Graphics + mouse/touch systems are build on top of the CLI. Also, your first computer programs are going to run on the command line, so you’ll need to learn how to see them. Every computer+OS has one. On Unix, Linux and Mac, it’s called a Terminal (or command shell). On Windows it’s called Windows Command Line and evolved from DOS, Microsoft’s first PC operating system from 1981.

  • Apps: Copy CH Online DOS, DOS command line.

  • Tasks: create empty text files, create directories, navigate directories, delete directories, execute programs, write batch files (files containing several commands instead of typing each time)

  • This should take a single course to cover. — 1 week




3. The C Programming Language

The C programming language is the origin for of most modern programming languages like C++, Swift, PHP & Java. Most apps that need to run fast (3D games, CAD, artificial intelligence, photo/video editing) are written in C or C++. 

VS Code and classic “Hello World” program in C

VS Code and classic “Hello World” program in C

  • Apps: Online IDE, Microsoft VS Code (VS Code)

  • Book - Programming In C (4th Edition), by Stephen Kochan (4th Edition)

    The book is well-written and thoroughly covers the C language. I’ll just give you a resume of each chapter and type the examples so you can do the same. By doing one chapter a week, it will take us around 4-6 months to go through this.

  1. Some Fundamentals

  2. Compiling and running Your First Program

  3. Variables, Data Types, and Arithmetic Expressions

  4. Program Looping

  5. Making Decisions

  6. Working With Arrays

  7. Working With Functions

  8. Working With Structures

  9. Character Strings

  10. Pointers

  11. Operations on Bits

  12. The Preprocessor

  13. Extending Data Types with Enumerated Data Type. Type Definitions, and Data Type Conversions.

  14. Working with Larger Programs

  15. Input and Output Operations in C

  16. Miscellaneous and Advanced Features

  17. Debugging Programs

  18. Object-Oriented Programming





4. Design Patterns

Design Patterns are standardized solutions to programming problems. They’re like matching a screwdriver with a screw with a pattern head. Phillip screwdriver for cross pattern and a torq screwdriver for security screws. Likewise, you use the Singleton pattern with you want just one copy of an object to exist, or the Composition pattern when you want to include objects inside other objects, or the Observer pattern when you want to trigger an object’s behaviour based on the state of another object.

The book describes the software design patterns — general, reusable solution to common software design problems. It is one of the most influential computer science book of the past 30 years. Here’s a short description of each pattern and their utility:

  1. Strategy Defines a family of algorithms, encapsulates each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients who use it.

  2. Decorator Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

  3. Factory Method — Define an interface for creating an object, but let the subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

  4.  Observer — Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

  5. Chain of Responsibility — Avoid coupling the sender of a request to its receiver by giving more then one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

  6. Singleton — Ensure a class only has one instance, and provide a global point of access to it.

  7. Flyweight — Use sharing to support large numbers of fine-grained objects efficiently. A flyweight is a shared object that can be used in multiple contexts simultaneously. The flyweight acts as an independent object in each context; it’s indistinguishable from an instance of the object that’s not shared.

  8. Adapter — Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatibility interfaces.

  9. Façade — Provide a unified interface to a set of interfaces in a system. Façade defines a higher-level interface that makes the subsystem easier to use.

  10. Template Define a skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithms structure.

  11. Builder — Separate the construction of a complex object from its representation so that the same construction processes can create different representations.

  12. Iterator — Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

  13. Composite — Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

  14. Command — Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. 

  15. Mediator — Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and lets you vary their interaction independently.

  16. State — Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

  17. Proxy — Provide a surrogate or placeholder for another object to control access to it.

  18. Abstract Factory — Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

  19. Bridge — Decouple an abstraction from its implementation so that the two can vary independently.

  20. Interpreter — Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

  21. Memento — Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.

  22. Prototype — Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

  23. Visitor — Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.


Original Apple iPad

5. Web App Programming

Knowing web programming will allow you to create web sites and web applications (web apps), which are programs that can be run in a web browser.

  • Used for developing popular websites/apps like: Facebook, Twitter, TikTok, YouTube, etc.

  • HTML — Markup text language used to describe a page that a web browser (Chrome, FireFox, Safari)

  • TypeScript/JavaScript — Scripting language run by the web browser or a back-end server.