Forgotten C - Introduction

C is a language that's often misunderstood for it's quirks and unfriendliness, but this happens because people tend to see it through the wrong mindset.

What is a programming language?

A programming language is a formal language used to program a certain machine: Java controls the JVM, Python and Javascript control it's respectives environments, while C controls the processor and operating system.
You start to understand the choices and behaviors of the C language, when you look at it from the bottom of the abstraction tower (machine code and assembly), while most languages are taught to be seen from the top (natural language).

The Base of the Tower

For those who don't know assembly, a processor can only execute very simple instructions. Each processor has a different set, and each operating system has a different way to be called:
Exits program in DOS x86

    mov ah, 4ch
    mov al, 0
    int 21h

Exits program in Linux x86

    mov eax, 1
    xor ebx, ebx
    int 0x80

Exits program in Linux ARM

    mov r7, #1
    mov r0, #0
    svc #0

                
The most logical solution for this problem, would be making a language that provides the basic translation for more complex programs (or even languages) to be built on top.

Universal Language

C was invented to program a specific computer, called PDP-11, with a specific system, called UNIX. Due to how easy it was to port to another systems (just a few features on top of assembly), it quickly gained widespread usage, even before having a definied standard.

C became widely used in operating systems, libraries and programs, only replaced later by C++, which is a language inspired by C with more features and a different mindset.

However, the C programming language is still ubiquitous, and the base for important software like the Linux kernel, nginx, OpenSSL, CPython. The C API is basically omnipresent in multiple languages.

The Confusion of Tongues

There's a push against the C language by ideological groups, but that's not the point of this introduction or the tutorials: only a fool would engage in modern tribalism about one language being better than other.

The point of this tutorial is to teach the language in the manner it is intended to be used, along with the reasons behind misunderstood features. C is a hammer that's misused on screws because people forgot what nails are.