C's compromise and recognition to the new C++

  • Thread starter lovecreatesbea...
  • Start date
L

lovecreatesbea...

K&R say in the preface of their 2nd edition, "We used Bjarne
Stroustrup's C++ translator extensively for local testing of our
programs".

I don't know where they used the C++ in projects or only this book
source. But is it a message of the compromise and recognition to the
new C++?
 
J

Jack Klein

K&R say in the preface of their 2nd edition, "We used Bjarne
Stroustrup's C++ translator extensively for local testing of our
programs".

I don't know where they used the C++ in projects or only this book
source. But is it a message of the compromise and recognition to the
new C++?

No, this is a recognition of the fact that this book, and its code,
was written beginning several years before the first ANSI C standard
was finalized and approved.

The single most important feature added to the C language _ever_, not
just by the first ANSI standard, was function prototypes. C++ had
prototypes from the beginning, as they are necessary for function
overloading. Most C compilers at the time did not.

So using the Cfront preprocessor was the best way to get prototype
checking.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
 
F

flyreally

No, this is a recognition of the fact that this book, and its code,
was written beginning several years before the first ANSI C standard
was finalized and approved.

The single most important feature added to the C language _ever_, not
just by the first ANSI standard, was function prototypes. C++ had
prototypes from the beginning, as they are necessary for function
overloading. Most C compilers at the time did not.

So using the Cfront preprocessor was the best way to get prototype
checking.

--
Jack Klein
Home:http://JK-Technology.Com
FAQs for
comp.lang.chttp://c-faq.com/
comp.lang.c++http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html

i'm a Chinese student, my msm ID is :[email protected], could you
please add me as your fiend??
 
N

Nick Keighley

On Mon, 04 Jun 2007 19:57:43 -0700, "(e-mail address removed)"



No, this is a recognition of the fact that this book, and its code,
was written beginning several years before the first ANSI C standard
was finalized and approved.

The single most important feature added to the C language _ever_, not
just by the first ANSI standard, was function prototypes. C++ had
prototypes from the beginning, as they are necessary for function
overloading. Most C compilers at the time did not.

what I've always been curious about is why prototypes wern't in
from the beginning? You actual type *less* with prototypes.
 
R

Richard Heathfield

Nick Keighley said:
what I've always been curious about is why prototypes wern't in
from the beginning? You actual type *less* with prototypes.

Because dmr didn't think of using them?
 
F

Flash Gordon

Richard Heathfield wrote, On 05/06/07 09:51:
Nick Keighley said:


Because dmr didn't think of using them?

Did B have prototypes? If not then it was probably a carry over. Also
possibly to simplify the compiler.
 
B

Ben Bacarisse

Nick Keighley said:
what I've always been curious about is why prototypes wern't in
from the beginning? You actual type *less* with prototypes.

C evolved from an untyped language, B. One gets the feeling from what
they have written about it that the designers wanted to add as little
type information as possible. They were great fans of the simplicity
of B (and BCPL) and had seen the huge complexity of "modern" typed
languages like Algol 68.

Type information was added so that character arrays (and hence
strings) could be supported properly on the byte addressed hardware
that was being targeted. I guess just enough was put in so + (and
friends) would not what to add to a pointer. You don't need
prototypes for that.
 
R

Richard Tobin

Ben Bacarisse said:
They were great fans of the simplicity
of B (and BCPL) and had seen the huge complexity of "modern" typed
languages like Algol 68.

If you're going to put quotes around "modern" you should put them around
"huge" too.

-- Richard
 
B

Ben Bacarisse

If you're going to put quotes around "modern" you should put them around
"huge" too.

If you mean that both "huge" and "modern" were perceptions of the
time, then I wholeheartedly agree.
 
D

David Thompson

Nick Keighley <[email protected]> writes:

C evolved from an untyped language, B. One gets the feeling from what
they have written about it that the designers wanted to add as little
type information as possible. <snip>

Plus, most (other) typed 3GLs of the time -- FORTRAN, COBOL, PL/I --
had the list-of-ids then (list-of-)decls syntax. AFAIK only a68 then
had types-within-routine-decl -- and it allowed and arguably
encouraged complicated type specs that could rather frighten the
typical programmer, although not an experienced language implementer.
(Pascal and other Wirthians did so later. Don't know about JOVIAL.)

- formerly david.thompson1 || achar(64) || worldnet.att.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top