September 22, 1999 Strong Typing Slide #11

Strong Typing in Pascal and C is a Failure

Many spurious errors

Programmers ignore error messages that appear

Proliferation of type-defeating features

        int i;
        i = 1.42857;          /* Silently truncated to 1 */
        var u: case tag: integer of
                 0: (intval: integer);
                 1: (realval: real);
                 2: (stringval: array [1..20] of character);
                 3: (boolval: boolean);
               end;
            r : real;
        u.intval = 1428457;
        r = u.realval;          { Gack }

This proliferation is a sure sign of failure


Next Copyright © 1999 M-J. Dominus