# A-level Computing/AQA/Pascal

Pascal is a structured language specially designed by Niklaus Wirth for
learning programming and computer science.

## Why Pascal?

Pascal is accessible to beginners, its use of English-like syntax and
avoidance of curly brackets and other arcane symbols being similar to
Python and VB. Modern versions such as Delphi and Lazarus are very
flexible and powerful, enabling creation of console programs for AS as
well as very easy and rapid development of Graphical User Interfaces for
A2 projects. They also provide full support for Object-Oriented
Programming as required for A2. Pascal is the only language on the AQA
list which enables practical experience of pointer programming.

The open-source Free Pascal/Lazarus project provides a free, high
quality compiler and development environments for Windows, Linux and Mac
OSX.

The AQA textbook and exam papers use Pascal or Pascal-like pseudocode to
describe alogorithms.

## Why not Pascal?

The use of Pascal as a teaching language in universities peaked in the
1980\'s and is now probably extinct in the UK and US.

Pascal was never intended as a language for commercial development
though Delphi is used by some software companies especially in Eastern
Europe.

## Delphi or Free Pascal?

Lazarus/Free Pascal is
open-source, multi-platform and free!

Delphi runs only on Windows and costs
money (£23 per concurrent licence for educational use). However the
Development Environment is more polished, the compiler is much faster
and database connectivity is easier and more powerful.

## Getting Started

Download Lazarus from <http://sourceforge.net/projects/lazarus/files/>

## COMP1

Pascal fits the AQA specification very closely:

-   it\'s very easy to create console programs using a purely procedural
    approach (no objects or classes needed)
-   the use of value and reference parameters matches that described in
    the specification
-   it supports static arrays, records and sets as native data types
-   procedures and functions are distinguished and named as in the
    specification
-   traditional text files and typed files are supported

Pascal enforces strong typing and explicit variable declaration which
encourages students to think about data types before they code

## COMP3

Modern Pascal compilers provide full support for Object-Oriented
programming with a structure and syntax similar to that used in textbook
and exam questions.

The ability to use pointers explicitly, although indicative of Pascal\'s
1970\'s origins, does make it easy to teach some of the more difficult
data structure topics: linked lists, trees, use of the heap.

## COMP4

Delphi and Lazarus excel at the rapid development of graphical user
interfaces, allowing the student to spend much more time on the
underlying algorithms in their project. Only Microsoft Visual Studio
competes with this.

## Online resources

-   Delphi Basics a very clear and
    accesible reference, suitable for beginners
-   PP4S Pascal Programming for Schools,
    includes introductions to Lazarus and Delphi Object Pascal
    environments
-   Pascal Programming at Wikibooks
-   Delphi For Fun full of excellent example
    programs, including complex algorithms relevant to A2
-   About Delphi includes a very good course
    on connecting to databases

### Development environments

-   Embarcadero Delphi
    commercial and proprietary Object Pascal compiler and IDE
    -   Delphi via AQA
        (PDF)
-   Lazarus/Free Pascal open
    source Object Pascal compiler and Lazarus IDE

## Books

Pascal\'s long history in universities and industry mean that it is
thoroughly documented. Useful printed books are as follows:

  Title                                      ISBN         Suitable for
  ------------------------------------------ ------------ --------------------------------------------------
  Learning to Program in Pascal and Delphi   1904467296   specially written for A Level students
  Delphi in a Nutshell                       1565926595   reference guide for more experienced programmers
  Discover Pascal in Delphi                  0201709198   beginners

