How programming languages are created: declaring a variable

Programming languages like to stand out. Example: just declare a variable.

In this second part of the article: How programming languages ​ ​ are created, this time we study how variables are declared. It looks like two lines, Pascal and C, also with a little BASIC.

Langue Pascal (1970): Very formalistic, it was believed that the combination of declaration and initialization does it too much at the same time, inspired by Basic (see below).

var x : Integer;
x:= 10; 

Langue C (1972), C++ (1981), Java (1994), C # (2000): The more concise, the better it seems to think when you consider the number of programs written in these languages. But under the influence of Pascal (which the author will later say that he regrets), he adds a terminal semicolon to C and Java and C # will be imitated.

int x = 10;

Erlang (1986): Lesson C saved.

int x = 17; 

JavaScript (1995): Like C, but no type, and a semicolon as an option because we don't know too much if it's useful.

var x = 10

OCaml (1996): C found the formula, let's stay there.

int i = 17; 

Scala (2004): It would be too easy, let's go back to Pascal, but with a C shortening, int instead of Integer and keep the semicolon.

var x : Int;

Go Language (2009): We also go back to Pascal, but without the comma, which is actually useless.

var x int = 2

Dart (2011): We don't follow Go and go back to simplicity C. But go back to semicolon because that would be too easy.

int x = 10;

TypeScript (2012): I don't agree with simplicity, we return to Pascal, but with the type of number, like in Script (I like to notice this)... And back with a semicolon .

var x: number = 6;

In this competition of unnecessary difficulties, the winner is actually the first.... BAZIK (1964).

10 Dim x As Integer  
20 x = 10

Then they did not plan to declare a variable and assign it at the same time! But at least there is no comma, because we knew from the very beginning that it was useless...

Parler comme un codeur

Talk like a coder

What can you do with variables, why not do it with data structures?

The authors of Go worked on this:

type nom struct {
} 

This strongly resembles Pascal's record structure:

type nom = record
...
end;

In conclusion, when you want to innovate by creating a programming language, you abandon the C style and return to Pascal's style!!!