Making C a little more 'foolproof' (was Re: Naming)

Johan Vromans jv at mh.nl
Sat Mar 3 17:25:14 AEST 1990


In article <681 at mwtech.UUCP> martin at mwtech.UUCP (Martin Weitzel) writes:
> IMHO, there's a big 'philosophical' difference between languages like
> C, which obliges the programmer to do *all* error checking (namely for
> "fopen", "malloc" a.s.o., which may only fail under 'unusual conditions')
> and PASCAL, which does much more 'holding hands' at the cost, that the
> programmer has no chance to regain control, if a FILE cannot be opened,
> a NEW cannot make memory available a.s.o.
[ and much more ]

A very elegant approach was taken in the early 70's in Burroughs
Extended Algol. Some operations allowed multiple levels of control,
e.g.:
      READ(INFILE,COUNT,BUFFER)
	-> if something goes wrong, the system would trap it
      READ(INFILE,COUNT,BUFFER)[EOF]
	-> EOF handled by program, others by system
      RESULT := READ(INFILE,COUNT,BUFFER)
	-> complete control by the program

Real powerful language. They don't make them like that these days.

Johan
--
Johan Vromans				       jv at mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62944/62500
------------------------ "Arms are made for hugging" -------------------------



More information about the Comp.std.c mailing list