ambiguous ?

Joe English jeenglis at nunki.usc.edu
Fri Oct 20 11:03:34 AEST 1989


jlg at lanl.gov (Jim Giles) writes:

>The primary purpose of a programming language is to _unambiguously_
>specify the operation of an algorithm.  The extent to which C violates
>this is the extent to which C fails in the _purpose_ of a programming
>language.  This is a perfectly rational argument.  I suspect you will
>ignore it.

That's not a perfectly rational argument:
You *can* unambiguously specify the operation
of any algorithm in C.  The existence of 
legal expressions that are ambiguous doesn't
take away from the unambiguous ones.

The reason why C is one of the few languages
that accepts ambiguous statements is because C is
one of the few languages that allows more than
one side effect inside an expression.  I think
that's a more than reasonable tradeoff as long as
you know what you're doing.  The utility of
constructs like increment operators, treating
assignment like any other expression, and so on,
are well established.  So they lead to ambiguities
*if improperly used*.  So what?

[ Out of context quote follows: ]

> [...]it's so hard to convince C fanatics that
>there may be something wrong with their god (the C programming language
>that is).

All Hail the Mighty C, and its Prophets K&R!

[ Sorry, I couldn't resist that one... ]

--Joe English

  jeenglis at nunki.usc.edu.  



More information about the Comp.lang.c mailing list