38. ABC: the mother of Python

Type:
Poster
Audience level:
Novice
Category:
Core Python (Language, Stdlib)
March 11th 8 a.m. – 8:05 a.m.

Description

Before Python, Guido was a contributor to the ABC language and environment. ABC was designed to teach programming, and introduced many "Pythonic" ideas: integrated dicts and tuples, structure by indentation, strong typing without declarations etc. With high demand for Python in education, the legacy of ABC is more relevant than ever as we design courses and environments for learners.

Abstract

The main similarities and differences between Python and ABC will be shown, with tables showing features side-by-side, and a complete script in each language.

Among the similarities, we will highlight:

  • foreach style for command, with tuple unpacking;

  • block structure by indentation;

  • syntactic support and extensive use of dicts and tuples (called "tables" and "compounds");

  • unbounded strings;

Some ABC features that Python did not inherit will also be shown:

  • lists and dicts are only allowed to contain items of the same type;

  • variables can only be bound to a single type during one function invocation;

  • lists are automatically kept sorted (the rationale was: you either want a list to be sorted, or the ordering of the items is irrelevant);

  • numbers are either exact (represented as a ratio of two unbounded integers) or approximate (represented as hardware floats) and division between exact numbers always produces another exact number;

  • explicit files are not supported: instead, the environment auto-saves objects like functions and global variables in workspaces for use in future sessions;

ABC also includes an editor and interactive console with auto-completion, auto-indentation and other aids. Screen shots of the environment will be included.

The merits of these and some other features that Python dropped or changed will be discussed in the context of Python usage by people learning to program. For instance, although implicit persistency and constrained file I/O may be unacceptable to some professional programmers, there are similar features in programming systems designed for non-programmers, such as Smalltalk, Hypercard and more recently, Processing.