Re: Origins of == in C (Joachim Schrod)
Mon, 31 Jul 1995 10:59:16 GMT

          From comp.compilers

Related articles
Origins of == in C (1995-07-20)
Re: Origins of == in C (Doug CHAPPELL) (1995-07-25)
Re: Origins of == in C (Brendan Gowing) (1995-07-26)
Re: Origins of == in C (1995-07-28)
Re: Origins of == in C (1995-07-31)
Re: Origins of == in C (1995-08-01)
Re: Origins of == in C (David Toland) (1995-08-03)
Re: Origins of == in C (Bas V._de Bakker) (1995-08-09)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Joachim Schrod)
Keywords: C, design
Organization: TH Darmstadt, FG Systemprogrammierung
References: 95-07-135 95-07-158
Date: Mon, 31 Jul 1995 10:59:16 GMT

>, Brendan Gowing <> writes:
> >The distinction between = and == in C has caused me no end of grief. ...
> >[My recollection is that they used = for assignment because it's a lot more
> >common than comparison. Besides, it's Fortran-compatible. -John]
> The moderator's comment is correct. As far as I can remember, someone
> somewhere along the line found that the number of assignments in a
> typical program far outweighed the number of equality checks. This was
> acknowledged by C's designers who reasoned that the single "=" for
> assignment would save key strokes over the more typical ":=".

In his article _Development of C_, Dennis Ritchie writes:

        Other fiddles in the transition from BCPL to B were introduced AS
        A MATTER OF TASTE [emphasis mine], and some remain controversial,
        for example the decision to use the single character = for
        assignment instead of :=.

It doesn't read as some transition that are really well planned.


PS: Cited from the HOPL-II preprint (SIGPLAN Notices, March 93), p.202.
Joachim Schrod Email:
Computer Science Department
Technical University of Darmstadt, Germany

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.