Re: Origins of == in C

schrod@iti.informatik.th-darmstadt.de (Joachim Schrod)
Mon, 31 Jul 1995 10:59:16 GMT

          From comp.compilers

Related articles
Origins of == in C jpowers@ti.com (1995-07-20)
Re: Origins of == in C D.Chappell@biochem.usyd.edu.au (Doug CHAPPELL) (1995-07-25)
Re: Origins of == in C Brendan.Gowing@cs.tcd.ie (Brendan Gowing) (1995-07-26)
Re: Origins of == in C peter.schurek@banyan.siemens.co.at (1995-07-28)
Re: Origins of == in C schrod@iti.informatik.th-darmstadt.de (1995-07-31)
Re: Origins of == in C jmccarty@spdmail.spd.dsccc.com (1995-08-01)
Re: Origins of == in C det@sw.stratus.com (David Toland) (1995-08-03)
Re: Origins of == in C bas@phys.uva.nl (Bas V._de Bakker) (1995-08-09)
| List of all articles for this month |
Newsgroups: comp.compilers
From: schrod@iti.informatik.th-darmstadt.de (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 <Brendan.Gowing@cs.tcd.ie> 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.


Joachim


PS: Cited from the HOPL-II preprint (SIGPLAN Notices, March 93), p.202.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Joachim Schrod Email: schrod@iti.informatik.th-darmstadt.de
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.