Let’s once again start with our overview picture
and look at different high-level programming languages that we can use to write our algorithm. These programming languages can be used independently of a particular computer system and are a communication interface between a person and
a computer. Only the translator has to be adapted to the
respective system to generate the corresponding machine code. More about this at the end of the video. A statistic from 1970 has already listed about
700 programming languages. In the meantime, a lot more programming languages
have been invented and no one has the full overview today. Basically, a distinction is made between two
programming paradigms: Imperative and declarative programming languages Imperative languages use sequences of instructions
thus, excecute instruction after instruction. We distinguish two subgroups:
● First: Procedural languages, such as Fortran, Pascal, C, or Ada
● and second: Object-oriented languages, such as Java or C# These advanced methods and constructs make
the code easier to understand. Second, declarative languages. The declarative approach focuses on the what,
not the how. The programmer merely describes what the program
is supposed to do without specifying an exact algorithm. Programming tools usually offer additional
options for procedural and object-oriented programming. We once again distinguish between two subgroups:
● First: Functional languages, like Haskell or Lisp. ● And second: Logical languages, such as
Prolog Many languages combine several aspects such
as C++. Here features of a classic imperative
language have been combined with features from an object-oriented language. For programming beginners, it is a good idea
to start with a visual programming language. Unlike traditional programming languages,
which require code statements and complex syntax rules, here graphical programming blocks
are used that automatically snap together like Lego blocks when they make syntactical
sense. Well-known visual programming environments
are Scratch, Snap!, AppInventor, Google Blockly, or Catrobat. With these block-based programming languages
you can write just as powerful programs as with a common text-based programming language.
Let’s take a look at the last part of our overview graphic. We have now expressed our syntactically and
semantically correct algorithm into a programming language. But how does the computer execute my written
code and turn it into a program? Two terms are important: compiler and/or interpreter. Both have the task to translate and execute
the source code. In other words, they convert a programming
language into a computer-readable machine language. Depending on which programming language is
used, either compiler and interpreter are needed. This means the program is either compiled
or interpreted. A compiler is used for the programming languages
such as COBOL, Fortran, C++ or C. The translation into machine code is completed before the
program is executed. The machine code is stored as an executable
file, for example in the form of an *.EXE or *.COM file. When the program is started, this machine
code is loaded into the main memory and executed by the CPU instruction by instruction. The interpreter translates the code during
runtime. An instruction is read, analyzed and executed
immediately. Then process continues with the next statement
until the end of the program is obtained; or until an error occurs – the interpreter
stops as soon as something is wrong. Therefore, the developer knows very quickly
where the error is to find in the program, which makes debugging or finding the error
easier. However, by interpreting line by line, the execution time of the interpreter is much slower than of a compiler. Examples for interpreted languages are Basic,
PHP, Perl, Ruby, Python, JavaScript but also visual languages like Catrobat. Last but not least: The hybrid solution between
the two. This is known as a “just-in-time compiler”,
as it is used for example for Java, C# or VB .NET. An intermediate code or metacode is generated
and translated, for example, from virtual machine into an executable binary code. Now you are well prepared to write your
own program. In the next video you will get to know two
programming languages that support you in realizing your ideas.

Leave a Reply

Your email address will not be published. Required fields are marked *