Some general questions about C and good practice

M

Mark McIntyre

The book says "Copyright 2000" and "Reprinted with corrections in May
2003".

Then its either an erratum which the publishers need to correct, or a
piece of false information.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
J

jmcgill

Richard said:
My apologies; I did not realise that KimmoA was quoting from an edition
of the book that is so ancient it is useless in a discussion like this.

His "special edition" is the hardbound 3rd edition, ISBN0201700735, and
hardly "ancient."

Still,

C(x): x is a valid C program.
P(x): x is a valid C++ program.
\exists C(x) \in P(x), x \in {valid programs}

It doesn't mean anything in terms of a language specification, but
Stroustrup was observing that C++ can be, in some cases, a superset of C.
 
R

Richard Heathfield

[Attribs tersificated]

Mark McIntyre said:
Yes, which is what I said,

RH: "It's simply false."
MM: "Its not..."
RH: "It is"
MM: "Yes, which is what I said..."

Hmmm.
and indeed made exceptionally clear in the
quote that you gratuitously snipped.

Hardly gratuitous. We both know the context.
Whats your point exactly?

Just beyond your grasp, it appears. :-(
You're behaving oddly.

That's certainly an opinion. In /my/ opinion, however, I am behaving evenly.
 
C

Charlton Wilbur

jmcgill said:
His "special edition" is the hardbound 3rd edition, ISBN0201700735, and
hardly "ancient."

Still,

C(x): x is a valid C program.
P(x): x is a valid C++ program.
\exists C(x) \in P(x), x \in {valid programs}

It doesn't mean anything in terms of a language specification, but
Stroustrup was observing that C++ can be, in some cases, a superset of C.

But that is not what he said; there were further qualifiers in there
than mere validity and existence. There was a term "well-written"
that appears to have been left out of your formal statement entirely,
which is the crux of the matter.

Nobody disputes that there is a common subset of C and C++, in which
code can be written that it syntactically and semantically valid and
defined according to both languages. The dispute is in the part you
left out, which is that *well-written* valid C is likely to be valid
C++ as well. As can be demonstrated by a trivial counterexample, this
is not true.

Charlton
 
D

Default User

bjarne wrote:


Argh. My intent as I said in the previous message was to drop this, but
I'd better defend a bit.
Default User wrote:

as it is not valid C99. It was valid ARM C++ just as it was valid C89.

But the book didn't say that. It said every program in K&R2 *is* a
valid C++ program, not that they were when the book the came out. Two
different statements.
I think you should do more homework before casting doubt about other
people's statements.

I don't see that much is needed. The statement in the early section of
the book quoted here isn't accurate, although when the topic it covered
explicitly in later chapters it's of course correct.

There is a difference between C++ then and now. It's accurate to say,
"The programs were valid C++" but it's not to say (in a book about ISO
Standard C++), "The programs are valid C++".

This is not a huge deal, although it obviously caused some confusion
for at least one contributor here. I can't imagine me ever putting
together a textbook, let alone getting every single line and statement
crystal clean and unambiguous.

Again, and it bears repeating, my goal is NOT to insult, disparage, or
otherwise cast aspersions on Dr. Stroustrup over a single line in a 900
page text.




Brian (hope we can let her rest now)
 
M

Mark McIntyre

RH: "It's simply false."
MM: "Its not..."
RH: "It is"
MM: "Yes, which is what I said..."

Hmmm.

Have you mistaken me (or even yourself) for Jacob? I can see little
other reason for you deliberately and apparently maliciously not only
misquoting me but also making up quotes.
Just beyond your grasp, it appears. :-(

And being offensive is hardly grown up. Still, while we're at it,
bugger off and stop being so silly.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
R

Richard Heathfield

Mark McIntyre said:
Have you mistaken me (or even yourself) for Jacob?
No.

I can see little
other reason for you deliberately and apparently maliciously not only
misquoting me but also making up quotes.

No, sir; I have not misquoted you, or at least I have certainly not
/deliberately/ misquoted you, let alone /maliciously/ misquoted you, and I
have not made up any quotes whatsoever. I have elided some of what you've
said in an attempt to make your self-contradiction more obvious, but it's
implicit in what you said originally, so I'm not misrepresenting you.

I'm not sure why you're reacting so hostilely, given that my initial
response was very light-hearted, but I think it would be a good idea to
calm down a little.
 

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

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top