🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4981

Re: Software Technology is NOT Primitive

#4981
From: Douglas M. Pase
Date: Tue, 03 Nov 1987 18:34
41 lines
3039 bytes
In article <sol.3784> crowl@cs.rochester.edu (Lawrence Crowl) writes:
>
>I do not advocate a language in which it is impossible to avoid strong
>typing, just one in which avoidance is a clearly indicated, special
>operation.  The routine use of casts in C makes for an unsafe programming
>environment.
>
>The reason for covers on electrical panels is so that you do not accidently
>fry yourself.  You can still open the cover, but you must do so explicitly.
>The C approach is to tack bare wires onto the wall and announce that the
>competent homeowner will handle them correctly.
>

This is Baloney!  The use of casts is very much like the removal of the
panel cover.  Routine use of casts is like the routine removal of the cover!
If you don't know what you're doing, why are you using casts?  If you do,
why are you complaining?  C is a strongly typed language with one major hole -
the interface between function calls and declarations.  That is a hole which
lint fills.  (OK, so there are holes in lint a program could drive a truck
through.)  Casts are functions which take objects in one type space to objects
in another type space, subject to some "natural" mapping.  C is not nearly as
restrictive as, say, Pascal, but "restrictive" and "strongly typed" are not
equivalent terms.

Strongly typed means no errors occur because of type mismatches.  The single
most important place where such errors can occur is in function interfaces.
Lint catches most of those (assuming it is used).  In some compilers there may
be additional examples, such as pointers and integers being interchangeable.
The escape hatches are definitely built into `C', that is part of what makes
it such a useful and popular language.  Some examples of hatches are the `asm'
directive, and the unsupervised use of `union'.  Both of those can cause
incorrect operations to occur (e.g. integer add of floating point values).
The existance of the hatches doesn't force one to use them anymore than
leaving the keys in your ignition forces someone to steal your car.

I suppose someone is going to argue that C *isn't* strongly typed because
there are some places where it falls down, but I'm not interested in that
kind of argument.  I leave the taxonomy to those who are interested in it.
C enjoys most of the advantages of a strongly typed language, if not all.
--
Doug Pase   --   ...ucbvax!tektronix!ogcvax!pase  or  pase@cse.ogc.edu.csnet
Technical Details
Message-ID: <1485@ogcvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!littlei!ogcvax!pase
References: <3405@ece-csc.UUCP> <638@its63b.ed.ac.uk>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!littlei!ogcvax!pase
From: pase@ogcvax.UUCP (Douglas M. Pase)
Newsgroups: comp.lang.misc,comp.software-eng
Subject: Re: Software Technology is NOT Primitive
Message-ID: <1485@ogcvax.UUCP>
Date: Tue, 3-Nov-87 13:34:42 EST
Article-I.D.: ogcvax.1485
Posted: Tue Nov  3 13:34:42 1987
Date-Received: Sat, 7-Nov-87 17:29:27 EST
References: <3405@ece-csc.UUCP> <638@its63b.ed.ac.uk>
Reply-To: pase@ogcvax.UUCP (Douglas M. Pase)
Organization: Oregon Graduate Center, Beaverton, OR
Lines: 41