From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: Dan.Pop@cern.ch (Dan Pop) Subject: Re: What's the best language to start with? [was: Re: Should I learn C or Pascal?] Date: 1996/09/28 Message-ID: #1/1 X-Deja-AN: 185920318 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: <51knkn$j61@dub-news-svc-8.compuserve.com> <01bba638$e913f800$87ee6fce@timpent.a-sis.com> <324844D7.1507@trw.com> organization: CERN European Lab for Particle Physics newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada Date: 1996-09-28T00:00:00+00:00 List-Id: In bs@research.att.com (Bjarne Stroustrup) writes: >"Matthew M. Lih" writes: > > > > Even some veterans don't have any idea. I'm taking > > a C++ class, and the instructor didn't have any idea > > that the "++" operator was developed because it > > corresponded to a very quick machine language > > instruction in the old PDP machines. When I pointed > > this out, his comment was along the lines of "Oh, > > you hardware types." > >Actually, the story that ++ comes from the PDP11 instruction >set is a myth. Dennis Ritchie has denied it quite often, but >that doesn't seem to impress people. ++ is in C and C++ because >Dennis (being a mathematician) considered it a fundamental >(and useful) operation. It was in the PDP11 instruction set >because the designers at DEC independently had figured out >that it was an important operation to optimize. > > - Bjarne Actually, according to Dennis, ++ is in C because it was inherited from B :-) and the credit for it has to be given to Ken Thompson. Quoting from Ritchie himself: # C was developed on the PDP-11; most of it aside from the type # structure and associated syntax came from B, which was developed on # the PDP-7. B already had the ++ and -- operators (and the associated # idioms like *p++). The first B compiler produced interpreted # (threaded) code. Doubtless the invention of ++ and -- (due to # Thompson) was suggested by the auto-increment cells of the PDP-7, or # perhaps the one such cell on the PDP-8, or perhaps some of the more # recondite indirection modes on the GE 635/645, or the # count-increment-refill mechanism of the Stretch. In any event, neither # B nor the first C compiler generated -7 or -11 instructions that used # autoincrement. # # C was less influenced by the PDP-11 than most people think. Certainly # the addition of types was motivated by the desire to take advantage # of byte addressing and the (future) existence of floating point # (indeed, C compiled 11/45 floating point instructions before # the delivery of any 11/45s; it was an annoyance when DEC changed # its mind about what opcodes to use.) # # Discounting general things like that, the only strong PDP-11isms I can # think of in C are the signed characters and about 50% of the # justification for the widening rules for floats. (The other 50% is # simplification of the language rules and libraries). # # Dennis Ritchie # research!dmr # dmr@research.att.com -- Dan Pop CERN, CN Division Email: Dan.Pop@cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland