Features of Modula that would have been nice to have in Pascal

(This is a footnote to the remark on my homepage that no language beats Object Pascal)

In fact, as a language, I liked Modula better than Pascal. But Modula never got the popularity of Pascal; I don't know why. The features that I liked about Modula and which are missing in Pascal are mentioned on this page.

Note: Modula is very much like Pascal. The reason being that Modula was designed/developed by the same person (Wirth) who 'invented' Pascal; Modula was meant to be the 'successor' of Pascal.

  1. The syntax of Pascal concerning the use of the keywords begin and end is sometimes a bit confusing. The rules that Modula has for this are a lot more elegant:
  2. Importing stuff from units is done explicitly.
    Where Object Pascal has (for example)
    uses Graphics, SysUtils, Windows;
    Modula has:
    from Graphics import TBitmap;
    from SysUtils import IntToStr, Exception;
    from Windows import GlobalAllocPtr;
    
    This ensures that all identifiers that are used in a module / unit are always declared inside this unit and there is no ambiguity about 'double' identifiers that are exported by multiple units (TBitmap is an example of that).
    It makes it a lot easier to find where a certain identifier 'comes from' and what it means.
    I really wished Object Pascal had a similar feature.

By Reinier Sterkenburg.
Version 2 Aug 1999.