Crash Course on Pascal Programming

Named after the famous French mathematician and philosopher Blaise Pascal, Pascal is a procedural computer programming language that encourages the use of structured programming practices and data structuring.

Pascal is the brainchild of Swiss computer scientist Nikalus Wirth. He had created several other languages before Pascal, including Euler and ALGOL W. However, Wirth wanted to created a language to help students learn structured programming — a system aimed at improving the quality and development time of programs through the use of subroutines, while loops and block structures. This led to the creation of Pascal, which Wirth’s students used during their courses.

Ever since the creation of Pascal some 40 years ago, the language has been used in a wide range of applications, including computer games, embedded systems, Apple Lisa, and even the original Apple Macintosh operating system.

How Pascal Works

With roots originating back to the ALGOL language, Pascal was created with the goal of being an efficient language that utilizes the principles of structured programming. It allows programmers to define their other structured datatypes while also making it easier for programmers to create both dynamic and recursive data structures (e.g. lists and trees). Moreover, it supports features like were records, enumerations, dynamically allocated variables, and sets, among many others.

Pascal embraces a strong object typing, meaning that one data type cannot be translated into another data type unless it has been explicitly converted. Other programming languages have a similar strong typing on objects. Pascal also supports the use of nested procedure definitions while allowing the definitions and declarations to be made within subroutines.

Pascal, like many programming languages of today (but unlike most languages in the C family), allows nested procedure definitions to any level of depth, and also allows most kinds of definitions and declarations inside subroutines (procedures and functions). This enables a very simple and coherent syntax where a complete program is syntactically nearly identical to a single procedure or function (except for the heading, which has one of these three keywords).

Pascal Uses Semicolons as Statement Separators

Unlike PL/I, C and other programming languages, the current version of Pascal uses semicolons as statement separators. When the language was initial created, it didn’t use the extra semicolon, nor was it even permitted. But when ALGOL-style statements were introduced in the Revised Report, it prompted developers to implement this feature. Of course, the semicolon is option in most instances, and it’s still prohibited when used before “else” in the “if” statement. This is due to the fact that else follows a single statement instead of multiple, consecutive statements.

(Visited 916 times, 1 visits today)