[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: in defense of C

In article <9003012059.AA11786@schizo.samsung.com> gjc@mitech.com writes:
>In defense of C?
>(Or an apology for small extensible languages with minimal overhead
> and minimal required runtime libraries).

>It is so easy to build up error-checking routines from
>non-error-checking primitives.
>Here are some declarations from some code I use every day:
	[...example deleted...]
>Now, with prototype-enforcement there is absolutely no way my program is
>going to crash or behave badly if I use these three guys, cons_bitarray,
>bitaref and bitaset. 

Maybe a step farther is the TYPES package by Saul Youssef at Florida
State which provides an object-oriented programming environment within
a FORTRAN implementation.  By making careful use of arrays pretending
to be structures, it is possible to write fairly robust code even though
the language semantics provide very little protection on type-checking
on such.  The TYPES package provides queues, ordered sets, lists, etc.,
all accessible and operated on by FORTRAN subroutines.

Inquiries to youssef@scri1.scri.fsu.edu

>I claim: A good engineer can generate a much richer and more useful set of
>subroutines of this nature than found in ANY LANGUAGE DESIGNED BY COMMITTEE.

But should every engineer *have*to* generate all of those subroutines?
Certainly it is possible to write your own error-checking code and
such, but many of us were hired to get work done, not to individually
re-created safe programming languages/environments.

>... especially compared to those those languages who's references manuals
>start overflowing into multiple volumes!          -gjc

But it is certainly possible to write a fairly simple language which
provides a good degree of reliability and which does not allow many
of the most common forms of errors that C and FORTRAN are full of.
A good example is Turing-Plus, which combines a fairly restrictive
and safe language with the ability to do all those nasty things that
C and FORTRAN programmers love so....  You just have be be very specific
about telling the machine that you are doing something tricky.
Ditto for Modula-3, as far as I can tell. (I have not yet gotten
it operational on my SparcStation.)

Not all strongly-typed and checked languages need to be Ada....
John D. McCalpin - mccalpin@vax1.acs.udel.edu